--- loncom/interface/printout.pl 2004/11/13 08:25:41 1.70 +++ loncom/interface/printout.pl 2005/02/03 21:37:48 1.72 @@ -1,7 +1,7 @@ #!/usr/bin/perl # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc. # -# $Id: printout.pl,v 1.70 2004/11/13 08:25:41 albertel Exp $ +# $Id: printout.pl,v 1.72 2005/02/03 21:37:48 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ use File::Path; use IO::File; use Image::Magick; use Apache::lonhtmlcommon; +use Apache::lonnet(); use Apache::loncommon; use Apache::lonlocal; @@ -67,7 +68,7 @@ END my $advans_role = $ENV{'cgi.'.$identifier.'role'}; my $number_of_files = $ENV{'cgi.'.$identifier.'numberoffiles'}+1; my $student_names = $ENV{'cgi.'.$identifier.'studentnames'}; - my $backref = $ENV{'cgi.'.$identifier.'backref'}; + my $backref = &Apache::lonnet::unescape($ENV{'cgi.'.$identifier.'backref'}); my $adv = $ENV{'request.role.adv'}; @@ -112,23 +113,17 @@ END my $path=$eps_f; $path=~s/\/([^\/]+)\.eps$//; File::Path::mkpath($path,0,0777); - my $image = Image::Magick->new; $not_eps =~ s/^\s+//; $not_eps =~ s/\s+$//; - if ( exists($done_conversion{$not_eps})) { - next; - } + if ( exists($done_conversion{$not_eps})) { next; } if ($adv) { my $prettyname=$not_eps; $prettyname=~s|/home/([^/]+)/public_html|/priv/$1|; $prettyname=~s|$Apache::lonnet::perlvar{'lonDocRoot'}/|/|; - &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state,'Converting to EPS '.$prettyname); } + &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state,'Converting to EPS '.$prettyname); + } $done_conversion{$not_eps}=1; - my $status = $image->Read($not_eps); - if ($status) {print " $status ";} - $image->Set(page => '+100+200'); - $status = $image->Write($eps_f); - if ($status) {print " $status ";} + system("convert $not_eps $eps_f"); #check is eps exist in prtspool if(not -e $eps_f) { for (my $i=0;$i<10000;$i++) {