problem trying do convert some pdf's to jpg

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
cescaliante

problem trying do convert some pdf's to jpg

Post by cescaliante »

Hi All,

I've got a problem trying do convert some .pdf's to jpg on my Software.

If I try to upload some smallers pdf works fine, but when I try to upload some biggests pdf my convert didn't work... In my program I call the PHP function exec("convert -quality 100 -scale 600x800 /home/logo411/public_html/upload/extra_files/pdf_4a6dd5040df71.pdf[0] /home/logo411/public_html/upload/image_files/543804039e8f4bb1c00e26143fb90cf0.jpg");

When I tried to connect in my SSH server on SHELL COMMAND LINE works fine ... But when I try to configure a crontab to execute my sh file with this code didn't work too:

#!/bin/sh
convert -quality 100 -scale 600x800 /home/logo411/public_html/upload/extra_files/pdf_4a6dd5040df71.pdf[0] /home/logo411/public_html/upload/image_files/543804039e8f4bb1c00e26143fb90cf0.jpg
exit 0

And I got this message error:

Error: /syntaxerror in readxref
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1072/1123(ro)(G)-- --dict:0/20(G)-- --dict:93/200(L)-- --dict:93/200(L)-- --dict:97/127(ro)(G)-- --dict:229/230(ro)(G)-- --dict:14/15(L)--
Current allocation mode is local


The pdf file that I'm using. -> <a href="http://rapidshare.com/files/260722522/K ... ml">PDF</a>


Anyone knows what happens ?

Thanks.




This is my ghostscript and imagemagick version:

GNU Ghostscript 7.07 (2003-05-17)
Copyright (C) 2003 artofcode LLC, Benicia, CA. All rights reserved.

Version: ImageMagick 6.4.6 2009-03-31 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: problem trying do convert some pdf's to jpg

Post by Bonzo »

What happens if you change the code to this. As from version 6? the image should be called first.

Code: Select all

convert /home/logo411/public_html/upload/extra_files/pdf_4a6dd5040df71.pdf[0]  -scale 600x800  -quality 100 /home/logo411/public_html/upload/image_files/543804039e8f4bb1c00e26143fb90cf0.jpg
cescaliante

Re: problem trying do convert some pdf's to jpg

Post by cescaliante »

I changed the code, but still happen the same error... What I can't believe is why When i run in a shell command works fine but when the crontab of linux call the same sh file occur this error, Can be the environment variables ?

Thanks :)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: problem trying do convert some pdf's to jpg

Post by Bonzo »

It has been proved before that something that works in shell does not always work in the code and it tends to be an install/path problem.
Post Reply