version 1.98, 2006/04/24 21:30:06
|
version 1.99, 2006/06/06 11:04:18
|
Line 475 foreach $texfile (@texfile) {
|
Line 475 foreach $texfile (@texfile) {
|
"for $status_statement now Converting to PS", |
"for $status_statement now Converting to PS", |
\%prog_state,$new_name_file); |
\%prog_state,$new_name_file); |
if (-e $new_name_file) { |
if (-e $new_name_file) { |
|
&repaginate_postscript($new_name_file); |
print "<h1>PDF output file (see link below)</h1>\n"; |
print "<h1>PDF output file (see link below)</h1>\n"; |
$new_name_file =~ m/^(.*)\./; |
$new_name_file =~ m/^(.*)\./; |
my $ps_file = my $tempo_file = $1.'temporar.ps'; |
my $ps_file = my $tempo_file = $1.'temporar.ps'; |
Line 549 foreach $texfile (@texfile) {
|
Line 550 foreach $texfile (@texfile) {
|
"for $status_statement now Converting to PS", |
"for $status_statement now Converting to PS", |
\%prog_state,$new_name_file); |
\%prog_state,$new_name_file); |
if (-e $new_name_file) { |
if (-e $new_name_file) { |
|
&repaginate_postscript($new_name_file); |
print "<br />"; |
print "<br />"; |
$new_name_file =~ m/^(.*)\./; |
$new_name_file =~ m/^(.*)\./; |
my $ps_file = my $tempo_file = $1.'temporar.ps'; |
my $ps_file = my $tempo_file = $1.'temporar.ps'; |
Line 659 sub busy_wait_command {
|
Line 661 sub busy_wait_command {
|
} |
} |
|
|
|
|
|
# Repagninate a postscript file. |
|
# What we need to do: |
|
# - Count the number of pages in each student. |
|
# - Add pages between each student so that each student's output is |
|
# the maximum number of pages. |
|
# |
|
sub repaginate_postscript { |
|
# For now just strip out the STARTOFSTUDENTSTAMP |
|
# ENDOFSTUDENTSTAMP markers in the postscript. |
|
|
|
my ($postscript_filename) = @_; |
|
open(PSFILE, "<$postscript_filename"); |
|
my @psfilelines = <PSFILE>; |
|
close(PSFILE); |
|
my $psbody = join('', @psfilelines); |
|
$psbody =~ s/STARTOFSTUDENTSTAMP//g; |
|
$psbody =~ s/ENDOFSTUDENTSTAMP//g; |
|
|
|
open(PSFILE, ">$postscript_filename"); |
|
print PSFILE $psbody; |
|
|
|
close PSFILE; |
|
} |
|
|