Annotation of loncom/interface/printout.pl, revision 1.4

1.1       sakharuk    1: #!/usr/bin/perl
                      2: print "Content-type: text/html\n\n";
                      3: print "<body bgcolor=\"#FFFFFF\">\n";
1.4     ! sakharuk    4: print "<h1>OUTPUT is in the PDF FILE below</h1>\n";
        !             5: my ($texfile,$laystyle) = split(/&/,$ENV{'QUERY_STRING'});
        !             6: 
        !             7: print "$texfile\n";
1.1       sakharuk    8:  $_ = $texfile;
                      9:  m/^(.*)\/([^\/]+)$/; 
                     10: my $name_file = $2;
                     11: my $path_file = $1.'/';
                     12:  chdir $path_file;
                     13:  system("latex $name_file 1>/dev/null 2>/dev/null");
                     14:  $name_file =~ s/\.tex/\.dvi/;
                     15: my $new_name_file = $name_file;
                     16:  $new_name_file =~ s/\.dvi/\.ps/;
1.2       sakharuk   17: my $comma = "dvips -o $new_name_file";
                     18:  system("$comma $name_file");
                     19:  $_ = $new_name_file;
                     20:  m/^(.*)\./;
                     21: my $tempo_file = $1.'temporar.ps';
                     22: my $name_file = $1.'.pdf';
1.4     ! sakharuk   23: if ($laystyle eq 'album') {
        !            24:     $comma = "psnup -2 -s1.0 $new_name_file";
        !            25:     system("$comma $tempo_file"); 
        !            26:     system("ps2pdf $tempo_file $name_file");
        !            27: } elsif ($laystyle eq 'book') {
        !            28:     system("ps2pdf $new_name_file $name_file");
        !            29: }
        !            30: 
        !            31: 
1.1       sakharuk   32: 
                     33: 
1.3       albertel   34: print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";
1.1       sakharuk   35: print "\n";
                     36: 
                     37: 
                     38: 
                     39: 
1.4     ! sakharuk   40: 

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