--- loncom/interface/printout.pl 2024/07/11 12:44:40 1.171 +++ loncom/interface/printout.pl 2024/07/11 15:24:01 1.172 @@ -1,7 +1,7 @@ #!/usr/bin/perl # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc. # -# $Id: printout.pl,v 1.171 2024/07/11 12:44:40 raeburn Exp $ +# $Id: printout.pl,v 1.172 2024/07/11 15:24:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -544,7 +544,19 @@ foreach $texfile (@texfile) { last if ($device ne ''); } if ($device ne '') { - $comma = "gs -sDEVICE=$device -dLanguageLevel=1.5 --permit-file-read=* "; + my ($major,$minor); + if (open(PIPE,"gs -v |grep 'GPL Ghostscript' 2>&1 |")) { + my $info = ; + close(PIPE); + chomp($info); + if ($info =~ /Ghostscript\s+(\d+)\.(\d+)/) { + ($major,$minor) = ($1,$2); + } + } + $comma = "gs -sDEVICE=$device -dLanguageLevel=1.5 "; + if (($major > 9) || (($major == 9) && ($minor >= 50))) { + $comma .= '--permit-file-read=* '; + } &busy_wait_command("$comma -o $tempo_file $new_name_file 2>/dev/null 1>/dev/null", "for $status_statement now validating PS", \%prog_state, $tempo_file);