--- loncom/interface/printout.pl 2006/06/12 11:21:07 1.100 +++ loncom/interface/printout.pl 2006/06/12 18:05:02 1.101 @@ -161,7 +161,8 @@ END } &Apache::lonlocal::get_language_handle(); &Apache::loncommon::content_type(undef,'text/html'); - print(&Apache::loncommon::start_page('Creating PDF')); + + print(&Apache::loncommon::start_page('Creating PDF')); my $identifier = $ENV{'QUERY_STRING'}; my $texfile = $env{'cgi.'.$identifier.'.file'}; @@ -640,6 +641,7 @@ sub busy_wait_command { $SIG{CHLD} = \&REAPER; $done=0; + print("

Doing : $command"); my $pid=open(CMD,"$command |"); if ($advanced_role) { &Apache::lonhtmlcommon::Update_PrgWin('',$progress_win,$message); @@ -659,7 +661,7 @@ sub busy_wait_command { $SIG{CHLD}='IGNORE'; close(CMD); } - + print("

End

"); # Repagninate a postscript file. # What we need to do: @@ -693,7 +695,7 @@ sub repaginate_postscript { # Check for total pages (%%Pages:) - if (($line =~ "^%%Pages:") && (!$seen_pages)) { + if (($line =~ /^%%Pages:/) && (!$seen_pages)) { my @pageinfo = split(/ /,$line); $total_pages = $pageinfo[1]; $seen_pages = 1; @@ -704,7 +706,7 @@ sub repaginate_postscript { # we only are looking for the largest n (n is page number at the # bottom of the page, m the page number within the document. # - if ($line =~ "^%%Page:") { + if ($line =~ /^%%Page:/) { my @pageinfo = split(/ /, $line); if ($page_number < $pageinfo[1]) { $page_number = $pageinfo[1]; @@ -713,7 +715,7 @@ sub repaginate_postscript { # ENDOFSTUDENTSTAMP - save the page_number, reset and, if necessary # udpate max_pages. # - if ($line =~ "ENDOFSTUDENTSTAMP") { + if ($line =~ /ENDOFSTUDENTSTAMP/) { $pages_in_student[$student_number] = $page_number; $student_number++; @@ -753,15 +755,15 @@ sub repaginate_postscript { $total_pages += $add_pages; $student_number = 0; - open(PSFILE, "<$postscript_filename"); + open(PSFILE, "<$postscript_filename"); open(PSOFILE,">$postscript_filename"."repaginating"); # unique if original fname is. $seen_pages = 0; # Reset seen %%Pages flag... while ($line = ) { - if (($line =~ "^%%Pages:") && (!$seen_pages)) { + if (($line =~ /^%%Pages:/) && (!$seen_pages)) { $line = "%%Pages: $total_pages\n"; $seen_pages = 1; } - if ($line =~ "ENDOFSTUDENTSTAMP") { + if ($line =~ /ENDOFSTUDENTSTAMP/) { $add_pages = ($max_pages - $pages_in_student[$student_number]); $line = "\n"; my $last_student_page = $pages_in_student[$student_number]; @@ -776,10 +778,10 @@ sub repaginate_postscript { } $student_number++; } - print PSOFILE $line; + print PSOFILE ($line); } - close PSOFILE; - close PSFILE; + close(PSOFILE); + close(PSFILE); rename($postscript_filename."repaginating", $postscript_filename);