Page 1 of 1

Getting an error when trying to convert pdf to png

Posted: 2017-11-07T15:12:38-07:00
by troyd1
Linux server version:
2.6.32-71.el6.i686
My IM version:
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
My GS version:
GPL Ghostscript 8.70 (2009-07-31)

I am doing other modifications, but in the simplest form, I do convert file.pdf file.png

When doing it I am getting this mess:
Error: /undefined in findresource
Operand stack:
--dict:6/15(L)-- C2_0 8.999 --dict:5/5(L)-- --dict:5/5(L)-- Arial --dict:11/12(ro)(G)-- --nostringval-- CIDFontObject --dict:7/7(L)-- --dict:7/7(L)-- Adobe-Identity
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 7 1 6 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue
Dictionary stack:
--dict:1155/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:23/25(L)-- --dict:4/6(L)-- --dict:25/40(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
convert: Postscript delegate failed `00000871.pdf': No such file or directory @ pdf.c/ReadPDFImage/611.
convert: missing an image filename `test.png' @ convert.c/ConvertImageCommand/2800.

I am thinking a version upgrade of GS might fix this, but wanted some advice.

If I need to try a version upgrade of IM and/or GS, how can I do it and easily revert back in case it breaks other things?

Was thinking of saving the old folder and unzipping the new version in the same path location or does it not work that way? If so, where would that be.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-07T16:03:09-07:00
by fmw42
Your version 6.5.4-7 2012-05-07 is ancient (about 470 versions old). It goes back 5 years. Please try to upgrade. Your Ghostscript is also ancient and should be upgraded.

If you post your input PDF file to some free hosting service that will not change the format or zip the file first, then we can test on current versions of IM and Ghostscript.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-08T05:23:28-07:00
by troyd1
Yes, let me know if this image converts with your version. I put the file test.pdf on my google drive. Here is a link: https://drive.google.com/drive/folders/ ... 2Nmek9sNGM

If it converts, can you either tell me how to do a dual install of IM and GS so that I can test with it. I have other software using the old versions and cannot just upgrade and hope it works without a fall back.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-08T06:23:46-07:00
by snibgo
The pdf converts with no problem with IM v6.9.5-3 and GS v9.19.

I suspect the problem is GS, rather than IM. But such an old IM (v6.5.4-7) might also create problem, and may not work with a recent GS.

Dual-installations of IM are simple in Windows. I don't know about Linux, or GS. If you look at your IM file delegates.xml, how does it call Ghostscript? If it has a path, maybe you can change that to a new directory, install a recent GS to that directory, and try that.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-08T07:15:04-07:00
by troyd1
If I do a whereis on convert, I get /usr/bin/convert and identify is in the same place. Not sure, but would that mean it was installed with all the other commands? Where would I find the GS deletgate.xml? How can I set up a second version in linux or upgrade with the ability to downgrade easily? If I can set up a the new versions standalone, I can execute it using the full path to the new version of the convert command.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-08T08:19:28-07:00
by snibgo
Run convert with "-debug all" to see where IM finds delegates.xml. This is a text file.

Re: Getting an error when trying to convert pdf to png

Posted: 2017-11-08T10:37:55-07:00
by fmw42
You can find it on Unix by

Code: Select all

find /usr | grep "delegates.xml"
On my Mac it is at

/usr/local/etc/ImageMagick-6/delegates.xml