File:  [LON-CAPA] / loncom / interface / printout.pl
Revision 1.4: download - view: text, annotated - select for diffs
Wed Mar 6 20:43:47 2002 UTC (22 years, 2 months ago) by sakharuk
Branches: MAIN
CVS tags: HEAD
added some functionality

    1: #!/usr/bin/perl
    2: print "Content-type: text/html\n\n";
    3: print "<body bgcolor=\"#FFFFFF\">\n";
    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";
    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/;
   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';
   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: 
   32: 
   33: 
   34: print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";
   35: print "\n";
   36: 
   37: 
   38: 
   39: 
   40: 

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