thanks man.. this doesnt match my program but i understood how to use the module!! my program exports brochures which have some images.. i made the templates and now i will put in these codes to convert images to base64... thanks again :))
----- Original Message ----- From: "Michael Higgins" <[EMAIL PROTECTED]> To: "[e]agLØrT" <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 1:46 AM Subject: Re: reading image files > [e]agLØrT wrote: > > i didnt test the code but i think this is exactly whak i look for! > > thanks a lot... also thanks to others that sent a reply.. :)) > > > > > > This attached file I made with perl. If you want font pictures to play > with let me know & I'll send 'em along. > > I've include the script, as hacked together as it is. ;-) > > -- mike higgins > > ----------------------------------- > > use CGI; > use MIME::Lite; > use Text::Wrap qw(wrap $columns); > use strict; > open MIMEST, ">outfile.mht"; > > $columns = 20; > > my $fontbase = 'lucon'; > my $res = '210x240'; > > my $target_width = 28; > my $target_height = 32; > my $align = 'center'; > my $valign = 'middle'; > my $fontfolderbase = 'c:/Documents and > Settings/mh296/Desktop/text2mht/gifs'; > my $folder = $fontfolderbase.'/'.$fontbase.$res; > > #type a line of text here (for now). \n\n becomes paragaraph break. > my $line = q > ¦Not a model man, > > Not a saviour or a saint -- > > Imperfect, in a word: > > Make no mistake! > > -- "Not a Model Man" Adrian Belew/King Crimson¦; > > > my $data; > > my %attachme; > > my $msg = MIME::Lite->new( > Type =>'multipart/related' > ); > > > $line =~ s/(?<!\n)\n/ /sm; > $line =~ s/ / /gsm; > > $line = wrap('','',$line); > print $line; > > my @words = split (/\n/, $line); > > my $cgi = new CGI; > > #print $cgi->header(); > > $data .= $cgi->start_html(-bgcolor=>"#000000"); > $data .= $cgi->start_table({-align=>"center", -BORDER=>"0", > CELLSPACING=>"0", CELLPADDING=>"0" }); > $data .= "<tr>\n"; > my @t = sort {$b <=>$a} map{length($_)[EMAIL PROTECTED]; > my $longest_word = $t[0]; > > > foreach my $word (@words) > { > > #$data .= "<br />\n"; > > my @letters = split //, $word; > > @letters = map {$_ = $fontbase.sprintf("%03d",ord($_)).'.gif'[EMAIL PROTECTED]; > print join ("\n",@letters); > > for(1..$longest_word){ > $data .= "<td>\n"; > my $letter = shift @letters; > $attachme{$letter}++; > $data .= $cgi->img ({src => "cid:$letter", BORDER=>"0", WIDTH=> > $target_width, HEIGHT => $target_height, ALIGN =>$align, VALIGN > =>$valign }) if ($letter); > # $data .="\n"; > $data .= "</td>\n"; > } > $data .= "</tr>\n"; > $data .= "<tr>\n"; > $data .= "<td>\n"; > $data .= "<p> </p>\n"; > $data .= "</td>\n"; > $data .= "</tr>\n"; > #$data .= "<br />\n";; > } > > $data .= $cgi->end_table; > $data .= $cgi->end_html; > > > $msg->attach(Type => 'text/html', > Data => $data > ); > > # add pictures of text > > foreach my $letter (keys %attachme){ > next if ($letter eq ''); > $msg->attach(Type => 'image/gif', > Id => $letter, > Path => "$folder/$letter", > ) ; > } > > $msg->print(\*MIMEST); > --- Bu posta, gönderilmeden önce VİRÜS taramasından geçmiştir. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 10.01.2003 _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs