Page 1 of 1

OK, really a GhostScript PDF question....

Posted: 2012-08-08T15:20:51-07:00
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

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

Posted: 2012-08-08T19:11:56-07:00
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

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

Posted: 2012-08-08T20:07:12-07:00
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.

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

Posted: 2012-08-08T20:40:02-07:00
by fmw42
can you post a link to your pdf file?

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

Posted: 2012-08-08T22:26:39-07:00
by johlaf
Sorry, there is a restriction on the content :(

can you sugest any tools to collect file property information?

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

Posted: 2012-08-09T00:58:41-07:00
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.

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

Posted: 2012-08-09T10:22:27-07:00
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...)

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

Posted: 2012-08-09T19:19:16-07:00
by johlaf
Thanks everyone. The move to 9.06 has fix the problem :D