version 1.5, 2002/04/10 16:23:24
|
version 1.6, 2002/04/12 13:46:11
|
Line 1
|
Line 1
|
#!/usr/bin/perl |
#!/usr/bin/perl |
use Image::Magick; |
use IO::File; |
print "Content-type: text/html\n\n"; |
print "Content-type: text/html\n\n"; |
print "<body bgcolor=\"#FFFFFF\">\n"; |
print "<body bgcolor=\"#FFFFFF\">\n"; |
print "<h1>OUTPUT is in the PDF FILE below</h1>\n"; |
print "<h1>OUTPUT is in the PDF FILE below</h1>\n"; |
my ($texfile,$laystyle,$notepslist) = split(/&/,$ENV{'QUERY_STRING'}); |
my ($texfile,$laystyle,$needconvert) = split(/&/,$ENV{'QUERY_STRING'}); |
|
if ($needconvert) { |
#if ($notepslist ne '') { |
my $temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n"; |
# my $image = Image::Magick->new; |
my @content_of_file = <$temporary_file>; |
my $newnotepslist = $notepslist; |
my $content_file_string = join(' ',@content_of_file); |
$newnotepslist =~ s/\.eps/\.gif/; |
my $b_noteps = index($content_file_string,'\needepsconversion{',0); |
# $image->Read("gif:$newnotepslist"); |
while ($b_noteps != -1) { |
# $image->Set(page => '+100+200'); |
my $e_noteps = index($content_file_string,'}',$b_noteps); |
$_ = $notepslist; |
my $notepslist = substr($content_file_string,$b_noteps+19,$e_noteps-$b_noteps-19); |
m/\/(\w+\.eps)/; |
my $newnotepslist = $notepslist; |
$notepslist = $1; |
$newnotepslist =~ s/\..*$/\.eps/; |
# $image->Write("eps:$notepslist"); |
$_ = $newnotepslist; |
# open(EPS,$notepslist) or die "Couldn't open the EPS file: $!"; |
m/\/(\w+\.eps)/; |
# undef $/; |
$newnotepslist = $1; |
# my $eps = <EPS>; |
$newnotepslist = '/home/httpd/prtspool/'.$1; |
# close EPS; |
system("convert gif:$notepslist eps:$newnotepslist" ); |
$notepslist = '/home/httpd/prtspool/'.$1; |
$b_noteps = index($content_file_string,'\needepsconversion{',$e_noteps); |
# open(OUT,'>'.$notepslist) or die "Couldn't open the output EPS file: $!"; |
} |
# print OUT <<EndPrint; |
close $temporary_file; |
#/Times-Roman findfont 48 scalefont setfont |
} |
#100 150 moveto |
|
#(This is an EPS graphic) show |
|
#EndPrint |
|
#print OUT $notepslist; |
|
#print OUT "showpage\n"; |
|
#close OUT; |
|
print" aaa: $newnotepslist\n"; |
|
print" bbb: $notepslist\n CCC: "; |
|
system("convert gif:$newnotepslist eps:$notepslist" ); |
|
#} |
|
print "$texfile\n"; |
print "$texfile\n"; |
$_ = $texfile; |
$_ = $texfile; |
m/^(.*)\/([^\/]+)$/; |
m/^(.*)\/([^\/]+)$/; |