[LON-CAPA-cvs] cvs: loncom /interface printout.pl

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 06 Mar 2002 20:43:47 -0000


sakharuk		Wed Mar  6 15:43:47 2002 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  added some functionality
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.3 loncom/interface/printout.pl:1.4
--- loncom/interface/printout.pl:1.3	Fri Dec  7 18:16:22 2001
+++ loncom/interface/printout.pl	Wed Mar  6 15:43:47 2002
@@ -1,8 +1,10 @@
 #!/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'};
+print "<h1>OUTPUT is in the PDF FILE below</h1>\n";
+my ($texfile,$laystyle) = split(/&/,$ENV{'QUERY_STRING'});
+
+print "$texfile\n";
  $_ = $texfile;
  m/^(.*)\/([^\/]+)$/; 
 my $name_file = $2;
@@ -18,9 +20,15 @@
  m/^(.*)\./;
 my $tempo_file = $1.'temporar.ps';
 my $name_file = $1.'.pdf';
- $comma = "psnup -2 -s1.0 $new_name_file";
- system("$comma $tempo_file"); 
- system("ps2pdf $tempo_file $name_file");
+if ($laystyle eq 'album') {
+    $comma = "psnup -2 -s1.0 $new_name_file";
+    system("$comma $tempo_file"); 
+    system("ps2pdf $tempo_file $name_file");
+} elsif ($laystyle eq 'book') {
+    system("ps2pdf $new_name_file $name_file");
+}
+
+
 
 
 print "<a href=\"/prtspool/$name_file\">Your PDF document</a>\n";
@@ -29,8 +37,4 @@
 
 
 
-#    my $ere;
-#    foreach $ere (%ENV) {
-#	print(' SS '.$ere.' => '.$ENV{$ere}.' FF '."\n\n");
-#    }
- 
+