version 1.148, 2011/04/26 10:47:25
|
version 1.150, 2011/10/26 02:09:42
|
Line 44 use LONCAPA::Configuration;
|
Line 44 use LONCAPA::Configuration;
|
use strict; |
use strict; |
|
|
my $busy_wait_timeout = 30; |
my $busy_wait_timeout = 30; |
|
my $pdfs_converted = 0; # non zero if PDF includes (need to fixps). |
|
|
my $debugging = 0; |
my $debugging = 0; |
|
|
Line 490 foreach $texfile (@texfile) {
|
Line 490 foreach $texfile (@texfile) {
|
# The code below uses gs to make pdf includes in sequences work |
# The code below uses gs to make pdf includes in sequences work |
|
|
# Use gs to fix the postscript -> level 1.5 |
# Use gs to fix the postscript -> level 1.5 |
|
# .. if pdfs were included |
|
|
$comma = "gs -sDEVICE=pswrite -dLanguageLevel=1.5 "; |
if ($pdfs_converted > 0) { |
&busy_wait_command("$comma -o $tempo_file $new_name_file 2>/dev/null 1>/dev/null", |
$comma = "gs -sDEVICE=pswrite -dLanguageLevel=1.5 "; |
"for $status_statement now validating PS", |
&busy_wait_command("$comma -o $tempo_file $new_name_file 2>/dev/null 1>/dev/null", |
\%prog_state, $tempo_file); |
"for $status_statement now validating PS", |
|
\%prog_state, $tempo_file); |
|
|
#--- |
#--- |
&busy_wait_command("mv $tempo_file $new_name_file", |
&busy_wait_command("mv $tempo_file $new_name_file", |
'File move', \%prog_state, $new_name_file); |
'File move', \%prog_state, $new_name_file); |
|
} |
if ($laystyle eq 'album' and $numberofcolumns eq '2') { |
if ($laystyle eq 'album' and $numberofcolumns eq '2') { |
$comma = "psnup $papera -2 -s1.0 $new_name_file"; |
$comma = "psnup $papera -2 -s1.0 $new_name_file"; |
&debug("PSNUP command: $comma"); |
&debug("PSNUP command: $comma"); |
Line 894 sub convert_figure {
|
Line 897 sub convert_figure {
|
my $status_statement='EPS picture for '.$not_eps; |
my $status_statement='EPS picture for '.$not_eps; |
my $eps_f = $not_eps; |
my $eps_f = $not_eps; |
|
|
if ($eps_f=~/\/home\/([^\/]+)\/public_html\//) { |
if ($eps_f=~/\/home\/httpd\/html\/priv\/[^\/]+\/([^\/]+)\//) { |
$eps_f=~s/\/home\/([^\/]+)\/public_html/$1/; |
$eps_f=~s/\/home\/httpd\/html\/priv\/[^\/]+\/([^\/]+)/$1/; |
} elsif ($eps_f=~/$perlvar{'lonDocRoot'}\/res\//) { |
} elsif ($eps_f=~/$perlvar{'lonDocRoot'}\/res\//) { |
$eps_f=~ s/$perlvar{'lonDocRoot'}\/res\/(.+)/$1/; |
$eps_f=~ s/$perlvar{'lonDocRoot'}\/res\/(.+)/$1/; |
} elsif ($eps_f=~/$perlvar{'lonUsersDir'}\//) { |
} elsif ($eps_f=~/$perlvar{'lonUsersDir'}\//) { |
Line 928 sub convert_figure {
|
Line 931 sub convert_figure {
|
$not_eps =~ s/ /\\ /g; |
$not_eps =~ s/ /\\ /g; |
my $prettyname=$not_eps; |
my $prettyname=$not_eps; |
if ($advanced_role) { |
if ($advanced_role) { |
$prettyname=~s|/home/([^/]+)/public_html|/priv/$1|; |
|
$prettyname=~s|$perlvar{'lonDocRoot'}/|/|; |
$prettyname=~s|$perlvar{'lonDocRoot'}/|/|; |
&Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, |
&Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, |
'Converting to EPS '.$prettyname); |
'Converting to EPS '.$prettyname); |
Line 948 sub convert_figure {
|
Line 950 sub convert_figure {
|
|
|
&debug("Converting pdf $not_eps to postscript: $eps_f"); |
&debug("Converting pdf $not_eps to postscript: $eps_f"); |
system("pdftops $not_eps $eps_f"); |
system("pdftops $not_eps $eps_f"); |
|
$pdfs_converted++; # Need to fix ps in last pass. |
} else { |
} else { |
system("convert $not_eps $eps_f"); |
system("convert $not_eps $eps_f"); |
if($? and $advanced_role){ |
if($? and $advanced_role){ |