Convert and GS
Posted: 2007-09-06T09:57:20-07:00
I have a perl program that is converting a pdf file to a jpg using
imagemagik and gs. Using the following command line in a telnet shell
logged in as the webmaster and in the same directory as the perl
program it works:
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
But when I do it in perl with the following:
system("cd $displaypath;/usr/local/bin/convert $THISPROJECT
$thepagemap[$i].pdf -resize 300 $THISPROJECT$thepagemap[$i].jpg");
which expands out to (same as above):
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
I get this error:
sh: gs: command not found
convert: Postscript delegate failed
`ZGRH3122CHAP070827063618-1-1.pdf'.
convert: missing an image filename `ZGRH3122CHAP070827063618-1-1.jpg'.
Anyone have any clue why I would get this error? Convert works fine,
it just doesn't work with gs (ghostscript) when I call it from the
perl (but does work at the command prompt). Also gs is in /usr/local/bin same as convert.
Bill H
imagemagik and gs. Using the following command line in a telnet shell
logged in as the webmaster and in the same directory as the perl
program it works:
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
But when I do it in perl with the following:
system("cd $displaypath;/usr/local/bin/convert $THISPROJECT
$thepagemap[$i].pdf -resize 300 $THISPROJECT$thepagemap[$i].jpg");
which expands out to (same as above):
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
I get this error:
sh: gs: command not found
convert: Postscript delegate failed
`ZGRH3122CHAP070827063618-1-1.pdf'.
convert: missing an image filename `ZGRH3122CHAP070827063618-1-1.jpg'.
Anyone have any clue why I would get this error? Convert works fine,
it just doesn't work with gs (ghostscript) when I call it from the
perl (but does work at the command prompt). Also gs is in /usr/local/bin same as convert.
Bill H