--- loncom/interface/printout.pl 2006/04/24 21:31:03 1.94.2.1
+++ loncom/interface/printout.pl 2006/04/20 02:24:08 1.97
@@ -25,20 +25,17 @@
# http://www.lon-capa.org/
#
-BEGIN {
- eval "use Apache2::compat();";
-};
use lib '/home/httpd/lib/perl';
use LONCAPA::loncgi;
use File::Path;
use File::Basename;
use IO::File;
use Image::Magick;
-use Apache::lonhtmlcommon;
+use Apache::lonhtmlcommon();
use Apache::lonnet;
-use Apache::loncommon;
+use Apache::loncommon();
use Apache::lonlocal;
-use Apache::lonmsg;
+use Apache::lonmsg();
use LONCAPA::Enrollment;
use strict;
@@ -164,8 +161,7 @@ END
}
&Apache::lonlocal::get_language_handle();
&Apache::loncommon::content_type(undef,'text/html');
- my $bodytag=&Apache::loncommon::bodytag('Creating PDF','','');
- print $bodytag;
+ print(&Apache::loncommon::start_page('Creating PDF'));
my $identifier = $ENV{'QUERY_STRING'};
my $texfile = $env{'cgi.'.$identifier.'.file'};
@@ -242,36 +238,15 @@ print "Return $eps_f"; # Debugging
system("convert $not_eps $eps_f");
- # check is eps exist in prtspool
- if (not -e $eps_f) {
- # converting an animated gif creates either:
- # anim.gif.eps.0
- # or
- # anim.gif-0.eps
+ #check is eps exist in prtspool
+ if(not -e $eps_f) {
for (my $i=0;$i<10000;$i++) {
if (-e $eps_f.'.'.$i) {
- rename($eps_f.'.'.$i, $eps_f);
- last;
- }
- my $anim_eps = $eps_f;
- $anim_eps =~ s/(\.[^.]*)\.eps$/$1-$i\.eps/i;
- if (-e $anim_eps) {
- rename($anim_eps, $eps_f);
+ rename $eps_f.'.'.$i, $eps_f;
last;
}
}
- }
- # imagemagick 6.2.0-6.2.7 fails to properly handle
- # convert anim.gif anim.gif.eps
- # it creates anim.eps instead.
- if (not -e $eps_f) {
- my $eps_f2 = $eps_f;
- $eps_f2 =~ s/\.[^.]*\.eps$/\.eps/i;
- if(-e $eps_f2) {
- rename($eps_f2,$eps_f);
- }
- }
-
+ }
}
}
if ($advanced_role) {
@@ -358,7 +333,10 @@ foreach $texfile (@texfile) {
\%prog_state,$dvi_file);
if ($tableofcontents eq 'yes') {
&busy_wait_command("latex $name_file 1>/dev/null 2>/dev/null",
- "for $status_statement now LaTeXing file for table of contents",
+ "for $status_statement First LaTeX of file for table of contents",
+ \%prog_state,$dvi_file);
+ &busy_wait_command("latex $name_file 1>/dev/null 2>/dev/null",
+ "for $status_statement Second LaTeX of file for table of contents",
\%prog_state,$dvi_file);
} #to create table of contents
my $idxname=$name_file;
@@ -628,7 +606,7 @@ if ($number_of_files>1) {
print "
A ZIP file of all the PDFs.";
}
if ($advanced_role) { &Apache::lonhtmlcommon::Close_PrgWin('',\%prog_state); }
-
+print(&Apache::loncommon::end_page());
my $done;
sub REAPER {
$done=1;