File:  [LON-CAPA] / loncom / interface / printout.pl
Revision 1.3: download - view: text, annotated - select for diffs
Fri Dec 7 23:16:22 2001 UTC (22 years, 5 months ago) by albertel
Branches: MAIN
CVS tags: stable_2002_spring, HEAD
- removed absolute bistromath references

    1: #!/usr/bin/perl
    2: print "Content-type: text/html\n\n";
    3: print "<body bgcolor=\"#FFFFFF\">\n";
    4: print "<h1>EXAMPLE</h1>\n";
    5: my $texfile = $ENV{'QUERY_STRING'};
    6:  $_ = $texfile;
    7:  m/^(.*)\/([^\/]+)$/; 
    8: my $name_file = $2;
    9: my $path_file = $1.'/';
   10:  chdir $path_file;
   11:  system("latex $name_file 1>/dev/null 2>/dev/null");
   12:  $name_file =~ s/\.tex/\.dvi/;
   13: my $new_name_file = $name_file;
   14:  $new_name_file =~ s/\.dvi/\.ps/;
   15: my $comma = "dvips -o $new_name_file";
   16:  system("$comma $name_file");
   17:  $_ = $new_name_file;
   18:  m/^(.*)\./;
   19: my $tempo_file = $1.'temporar.ps';
   20: my $name_file = $1.'.pdf';
   21:  $comma = "psnup -2 -s1.0 $new_name_file";
   22:  system("$comma $tempo_file"); 
   23:  system("ps2pdf $tempo_file $name_file");
   24: 
   25: 
   26: print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";
   27: print "\n";
   28: 
   29: 
   30: 
   31: 
   32: #    my $ere;
   33: #    foreach $ere (%ENV) {
   34: #	print(' SS '.$ere.' => '.$ENV{$ere}.' FF '."\n\n");
   35: #    }
   36:  

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