OK, really a GhostScript PDF question....

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
johlaf
Posts: 4
Joined: 2012-08-08T15:15:44-07:00
Authentication code: 67789

OK, really a GhostScript PDF question....

Post by johlaf »

.....but I was hopeing that after not getting any reply at the GhostScript form, that someone here may be able to help.

How can I identify what is wrong with this file. I run the commandline below on other files and it works fine. The file I am having trouble with opens in other PDF viewers (Adobe, GS, FoxIT)

Code: Select all

GSWIN64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="DIS_out.pdf" -f "DIS.pdf"

The return is:
 Error: /undefined in --get--
Operand stack:
   --dict:6/15(L)--   false   --dict:12/19(L)--   --dict:1/1(L)--   --nostringval--   JPXDecode   --dict:1/1(L)--   0
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
  --nostringval--   --nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   1893   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   4   --nostringval--   %for_pos_int_conti
nue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false
  1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   214562   --nostringval--   --nostringval--
--nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   --nostringva
l--
Dictionary stack:
   --dict:1160/1684(ro)(G)--   --dict:1/20(G)--   --dict:83/200(L)--   --dict:83/200(L)--   --dict:108/127(ro)(G)--   --
dict:295/300(ro)(G)--   --dict:23/30(L)--   --dict:6/8(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:8/17(L)--

Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.02: Unrecoverable error, exit code 1
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OK, really a GhostScript PDF question....

Post by fmw42 »

Have you checked to see if the PDF file is in CMYK rather than RGB format. I am not sure GS can handle CMYK. But I am no expert on GS
johlaf
Posts: 4
Joined: 2012-08-08T15:15:44-07:00
Authentication code: 67789

Re: OK, really a GhostScript PDF question....

Post by johlaf »

Thanks. The PDF is a collection of scanned JPG images. These are sRGB and I have used this type before. I can't find a colour space setting for the PDF file. I do now know that it was created with ABBYY.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: OK, really a GhostScript PDF question....

Post by fmw42 »

can you post a link to your pdf file?
johlaf
Posts: 4
Joined: 2012-08-08T15:15:44-07:00
Authentication code: 67789

Re: OK, really a GhostScript PDF question....

Post by johlaf »

Sorry, there is a restriction on the content :(

can you sugest any tools to collect file property information?
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: OK, really a GhostScript PDF question....

Post by indiego »

The return is:
Error: /undefined in --get--
Operand stack:
--dict:6/15(L)-- false --dict:12/19(L)-- --dict:1/1(L)-- --nostringval-- JPXDecode --dict:1/1(L)-- 0
Just a guess. GS seems to crash while decoding one of the images. The keywork here is 'JPXDecode'.
On page 67 of the PDF Reference Manual v1.7 it says:

"JPXDecode ... (PDF 1.5) Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data."

JPG2000 is a PDF1.5 feature, that is not compatible with PDF1.4! You can try to raise the compatibility level to '1.5' (-dCompatibilityLevel=1.5), but I donno if GS can handle JPEG2000 in general.
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: OK, really a GhostScript PDF question....

Post by pipitas »

Can you possibly install v9.06 (the most recent version) of Ghostscript and try again?

(BTW, Ghostscript should be able to handle JPEG2000 embedded images just fine and it also supports CMYK color spaces...)
johlaf
Posts: 4
Joined: 2012-08-08T15:15:44-07:00
Authentication code: 67789

Re: OK, really a GhostScript PDF question....

Post by johlaf »

Thanks everyone. The move to 9.06 has fix the problem :D
Post Reply