version 1.5, 2002/04/10 16:23:24
|
version 1.8, 2002/05/23 20:20:17
|
Line 1
|
Line 1
|
#!/usr/bin/perl |
#!/usr/bin/perl |
use Image::Magick; |
use IO::File; |
|
use Image::Magick; |
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 (see link below)</h1>\n"; |
my ($texfile,$laystyle,$notepslist) = split(/&/,$ENV{'QUERY_STRING'}); |
my ($texfile,$laystyle) = split(/&/,$ENV{'QUERY_STRING'}); |
|
my $figfile = $texfile; |
#if ($notepslist ne '') { |
$figfile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.dat/; |
# my $image = Image::Magick->new; |
print "GLYDI SUDY $figfile ENS"; |
my $newnotepslist = $notepslist; |
if (-e $figfile) { |
$newnotepslist =~ s/\.eps/\.gif/; |
my $temporary_file=IO::File->new($figfile) || die "Couldn't open file for reading: $!\n"; |
# $image->Read("gif:$newnotepslist"); |
my @content_of_file = <$temporary_file>; |
# $image->Set(page => '+100+200'); |
close $temporary_file; |
$_ = $notepslist; |
my $noteps; |
m/\/(\w+\.eps)/; |
foreach $not_eps (@content_of_file) { |
$notepslist = $1; |
if ($not_eps ne '') { |
# $image->Write("eps:$notepslist"); |
my $eps_f = $not_eps; |
# open(EPS,$notepslist) or die "Couldn't open the EPS file: $!"; |
$eps_f =~ s/\..*$/\.eps/; |
# undef $/; |
$_ = $eps_f; |
# my $eps = <EPS>; |
m/\/(\w+\.eps)/; |
# close EPS; |
$eps_f = '/home/httpd/prtspool/'.$1; |
$notepslist = '/home/httpd/prtspool/'.$1; |
my $image = Image::Magick->new; |
# open(OUT,'>'.$notepslist) or die "Couldn't open the output EPS file: $!"; |
$not_eps =~ s/^\s+//; |
# print OUT <<EndPrint; |
$not_eps =~ s/\s+$//; |
#/Times-Roman findfont 48 scalefont setfont |
$status = $image->Read($not_eps); |
#100 150 moveto |
if ($status) {print " $status ";} |
#(This is an EPS graphic) show |
$image->Set(page => '+100+200'); |
#EndPrint |
$status = $image->Write($eps_f); |
#print OUT $notepslist; |
if ($status) {print " $status ";} |
#print OUT "showpage\n"; |
} |
#close OUT; |
} |
print" aaa: $newnotepslist\n"; |
unlink $figfile; |
print" bbb: $notepslist\n CCC: "; |
} |
system("convert gif:$newnotepslist eps:$notepslist" ); |
|
#} |
|
print "$texfile\n"; |
print "$texfile\n"; |
$_ = $texfile; |
$_ = $texfile; |
m/^(.*)\/([^\/]+)$/; |
m/^(.*)\/([^\/]+)$/; |
Line 55 if ($laystyle eq 'album') {
|
Line 54 if ($laystyle eq 'album') {
|
system("ps2pdf $tempo_file $name_file"); |
system("ps2pdf $tempo_file $name_file"); |
} elsif ($laystyle eq 'book') { |
} elsif ($laystyle eq 'book') { |
system("ps2pdf $new_name_file $name_file"); |
system("ps2pdf $new_name_file $name_file"); |
} |
} |
|
my $texlog = $texfile; |
|
my $texaux = $texfile; |
|
my $texdvi = $texfile; |
|
my $texps = $texfile; |
|
$texlog =~ s/\.tex/\.log/; |
|
$texaux =~ s/\.tex/\.aux/; |
|
$texdvi =~ s/\.tex/\.dvi/; |
|
$texps =~ s/\.tex/\.ps/; |
|
my @garb = ($texlog,$texaux,$texdvi,$texps); |
|
unlink @garb; |
|
|
|
|
print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n"; |
print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n"; |