[LON-CAPA-cvs] cvs: loncom /interface printout.pl
sakharuk
lon-capa-cvs@mail.lon-capa.org
Thu, 12 Aug 2004 17:19:26 -0000
sakharuk Thu Aug 12 13:19:26 2004 EDT
Modified files:
/loncom/interface printout.pl
Log:
Support for other paper format.
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.63 loncom/interface/printout.pl:1.64
--- loncom/interface/printout.pl:1.63 Thu Aug 5 14:18:15 2004
+++ loncom/interface/printout.pl Thu Aug 12 13:19:25 2004
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
#
-# $Id: printout.pl,v 1.63 2004/08/05 18:18:15 sakharuk Exp $
+# $Id: printout.pl,v 1.64 2004/08/12 17:19:25 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -365,24 +365,31 @@
"for $status_statement now Modifying PS layout",
\%prog_state,$tempo_file);
} elsif ($laystyle eq 'book' and $numberofcolumns eq '2') {
- my @papers=('letter','legal','tabloid','executive','','a3','a4','a5','');
- my $papera=$papers[$paper];
- if ($papera ne '') {$papera='-p'.$papera;}
- $comma = 'pstops -pa4 "2:0+1(0.48w,0)"';
+ $comma = 'pstops "2:0+1(0.48w,0)"';
&busy_wait_command("$comma $new_name_file $tempo_file 1>/dev/null 2>/dev/null",
"for $status_statement now Modifying PS layout",
\%prog_state,$tempo_file);
} else {
$ps_file=$new_name_file;
}
- if ($paper eq '6') {
+ if (($paper eq '6') or ($paper eq '1') or ($paper eq '2') or ($paper eq '3')
+ or ($paper eq '4') or ($paper eq '5') or ($paper eq '7') or ($paper eq '8')) {
open(FFH,'<',$ps_file) || die "Couldn't open file for reading: $!\n";
my $new_ps_file='new'.$ps_file;
open(FFHS,'>',$new_ps_file) || die "Couldn't open file for reading: $!\n";
my $i=-1;
while (<FFH>) {
$i++;
- if ($i==0) {print FFHS '<< /PageSize [595.2 842] >> setpagedevice'."\n";}
+ if ($i==0) {
+ if ($paper eq '6') {print FFHS '<< /PageSize [595.2 842] >> setpagedevice'."\n";}
+ if ($paper eq '1') {print FFHS '<< /PageSize [612 1008] >> setpagedevice'."\n";}
+ if ($paper eq '2') {print FFHS '<< /PageSize [794.97 1228.59] >> setpagedevice'."\n";}
+ if ($paper eq '3') {print FFHS '<< /PageSize [542 722.7] >> setpagedevice'."\n";}
+ if ($paper eq '4') {print FFHS '<< /PageSize [1195.02 1690.09] >> setpagedevice'."\n";}
+ if ($paper eq '5') {print FFHS '<< /PageSize [842 1195.02] >> setpagedevice'."\n";}
+ if ($paper eq '7') {print FFHS '<< /PageSize [421.1 595.2] >> setpagedevice'."\n";}
+ if ($paper eq '8') {print FFHS '<< /PageSize [298.75 421.1] >> setpagedevice'."\n";}
+ }
print FFHS $_;
}
close(FFH);