File:  [LON-CAPA] / loncom / interface / printout.pl
Revision 1.1: download - view: text, annotated - select for diffs
Tue Oct 2 14:10:40 2001 UTC (22 years, 7 months ago) by sakharuk
Branches: MAIN
CVS tags: HEAD
cgi script version one

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "<h1>EXAMPLE</h1>\n";
my $texfile = $ENV{'QUERY_STRING'};
 $_ = $texfile;
 m/^(.*)\/([^\/]+)$/; 
my $name_file = $2;
my $path_file = $1.'/';
 chdir $path_file;
 system("latex $name_file 1>/dev/null 2>/dev/null");
 $name_file =~ s/\.tex/\.dvi/;
my $new_name_file = $name_file;
 $new_name_file =~ s/\.dvi/\.ps/;
my $pro_fun = "dvips -o $new_name_file";
 system("$pro_fun $name_file");
my $name_file = $new_name_file;
 $name_file =~ s/\.ps/\.pdf/;
 system("ps2pdf $new_name_file $name_file");


#print "<a href=\"http://bistromath.lite.msu.edu/$name_file\">Your PDF document</a>\n";
print "\n";




#    my $ere;
#    foreach $ere (%ENV) {
#	print(' SS '.$ere.' => '.$ENV{$ere}.' FF '."\n\n");
#    }
 

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