Diff for /loncom/interface/printout.pl between versions 1.5 and 1.13

version 1.5, 2002/04/10 16:23:24 version 1.13, 2002/08/01 18:09:27
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;  my $duefile = $texfile;
     my $newnotepslist = $notepslist;  $duefile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.due/;
     $newnotepslist =~ s/\.eps/\.gif/;  if (-e $figfile) {
 #    $image->Read("gif:$newnotepslist");      my $temporary_file=IO::File->new($figfile) || die "Couldn't open file for reading: $!\n";
 #    $image->Set(page => '+100+200');      my @content_of_file = <$temporary_file>;
     $_ = $notepslist;      close $temporary_file;  
     m/\/(\w+\.eps)/;      my $noteps;
     $notepslist = $1;      foreach $not_eps (@content_of_file) {
 #    $image->Write("eps:$notepslist");   if ($not_eps ne '') {
 #    open(EPS,$notepslist) or die "Couldn't open the EPS file: $!";      my $eps_f = $not_eps;
 #    undef $/;      $eps_f =~ s/\.[^.]*$/\.eps/i;
 #    my $eps = <EPS>;      $_ = $eps_f;
 #    close EPS;              m/\/([^\/]+)$/;
     $notepslist = '/home/httpd/prtspool/'.$1;      $eps_f = '/home/httpd/prtspool/'.$1;
 #    open(OUT,'>'.$notepslist) or die "Couldn't open the output EPS file: $!";      my $image = Image::Magick->new;
 #    print OUT <<EndPrint;      $not_eps =~ s/^\s+//;
 #/Times-Roman findfont 48 scalefont setfont      $not_eps =~ s/\s+$//;
 #100 150 moveto      $status = $image->Read($not_eps);
 #(This is an EPS graphic) show      if ($status) {print "  $status  ";}
 #EndPrint      $image->Set(page => '+100+200'); 
 #print OUT $notepslist;      $status = $image->Write($eps_f);    
 #print OUT "showpage\n";      if ($status) {print "  $status  ";}
 #close OUT;   }
     print"  aaa: $newnotepslist\n";      }
     print"  bbb: $notepslist\n   CCC: ";      unlink $figfile;
     system("convert gif:$newnotepslist eps:$notepslist" );  }
 #}  
 print "$texfile\n";  print "$texfile\n";
  $_ = $texfile;   $_ = $texfile;
  m/^(.*)\/([^\/]+)$/;    m/^(.*)\/([^\/]+)$/; 
Line 55  if ($laystyle eq 'album') { Line 55  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;
   unlink $duefile;
 print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";  print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";
 print "\n";  print "\n";
   

Removed from v.1.5  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>