Some pdf files fail

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Titus

Some pdf files fail

Post by Titus »

First I like to say "Hello" to this forum!

There are a few pdf files which can not be converted to jpg. No problem to open them with Acrobat or Preview, though. This line never returns:

Code: Select all

convert -colorspace rgb example.pdf example.jpg
After cancelling it these errors appear:

Code: Select all

convert: Postscript delegate failed `example.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `example.pdf' @ convert.c/ConvertImageCommand/2766.
Any ideas what could be the reason for this?

Mac OS-X 10.5.6
ImageMagick @6.4.8-9 (graphics, devel)
GPL Ghostscript 8.62 (2008-02-29)

Thanks in advance for any hint!

EDIT:
Meanwhile I've realized there is a newer version of gs. Now there is a more precise error when I try to open the pdf with gs (before that it was showing a "bus error" only):

Code: Select all

gs example.pdf
GPL Ghostscript 8.63 (2008-08-01)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 5.
Page 1
Error: /rangecheck in --.execform1--
Operand stack:
   --nostringval--   --dict:6/15(L)--   2   0.0   3.66643e-06
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1905   1   3   %oparray_pop   1904   1   3   %oparray_pop   1888   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   5   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   120   --nostringval--   1853   4   11   %oparray_pop   --nostringval--   false   1   %stopped_push   1852   4   11   %oparray_pop   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1144/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:106/127(ro)(G)--   --dict:275/300(ro)(G)--   --dict:22/25(L)--   --dict:4/6(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:2/5(L)--   --dict:3/5(L)--   --dict:1/1(ro)(G)--
Current allocation mode is local
GPL Ghostscript 8.63: Unrecoverable error, exit code 1
But this doesn't really help me :(
Titus

Bug in gs, how to work around?

Post by Titus »

Ok, found out it is a bug in ghostscript:
http://bugs.ghostscript.com/show_bug.cgi?id=689734

gs -dNOTRANSPARENCY example.pdf shows the file (not perfectly but anyway).

Now the question is: Is there any chance for a workaround in ImageMagick? More precise I need one for RMagick. :?
Titus

Re: Some pdf files fail

Post by Titus »

Does noone else run into this problem? :(
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Some pdf files fail

Post by magick »

See if this helps:
  • convert -colorspace rgb +matte example.pdf example.jpg
Titus

Re: Some pdf files fail

Post by Titus »

Great! This fixes the problem!

Thank you so much you saved my day!! :D
Titus

Re: Some pdf files fail

Post by Titus »

Ok, I was a bit too fast. Everything works fine for my test files. But I tested even the file from this corresponding thread: viewtopic.php?uid=12608&f=3&t=12944

For this one your solution doesn't work unfortunately. It says

Code: Select all

**** Warning:  File has an invalid xref entry:  4040.  Rebuilding xref table.
and hangs up.

But this thread should be closed anyway since I believe we are talking about two different problems.
Post Reply