Bug 692499 - Ghostscript fails to convert .pdf file (.pdf in attachment)
Summary: Ghostscript fails to convert .pdf file (.pdf in attachment)
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.04
Hardware: PC Linux
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 13:36 UTC by Juliusz Gonera
Modified: 2012-04-03 00:23 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Failing .pdf input for ghostscript (946.51 KB, application/pdf)
2011-09-13 13:36 UTC, Juliusz Gonera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juliusz Gonera 2011-09-13 13:36:07 UTC
Created attachment 7880 [details]
Failing .pdf input for ghostscript

INVOCATION
----------

  ghostscript -q -dBATCH -dNOPAUSE -sDEVICE=jpeg -sOutputFile=page_%02d file.pdf 

==============================================================================

TRACE
------


   **** Warning: can't process font stream, loading font by the name.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** Error reading a content stream. The page may be incomplete.
   **** File did not complete the page properly and may be damaged.
Error: /typecheck in --run--
Operand stack:
   --dict:8/17(L)--   1   10   3   12   5   14   7   16   9   18   11   20   13   22   15   24   Annots
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   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1155/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:108/127(ro)(G)--   --dict:291/300(ro)(G)--   --dict:23/30(L)--   --dict:6/8(L)--   --dict:22/40(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:11/15(L)--   --dict:8/15(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.04: Unrecoverable error, exit code 1
Comment 1 Marcos H. Woehrmann 2011-09-15 16:24:19 UTC
I've confirmed this problem happens with the current development version of Ghostscript and that muPDF and Acrobat 10.1.0 both open the file without problem (muPDF puts out some warnings).
Comment 2 Alex Cherepanov 2011-09-15 19:13:48 UTC
The problem is related to a large number of glyphs in the font and
PostScript restrictions on the size of composite objects. This causes
a cascade of other errors.
Comment 3 Ole Kaas 2011-11-11 12:01:45 UTC
What is the status of this issue? I get some similar errors when parsing a pdf file - see output below. I''l have to check if I'm allowed to publish the pdf file.

/usr/local/gs9.04/bin/gs -sPAPERSIZE=a4 -sDEVICE=pswrite -sOutputFile=/tmp/out.ps /tmp/KPK-Faktura261634.pdf 
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Can't find CID font "Arial".
Substituting CID font /Adobe-Identity for /Arial, see doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Identity" is not provided either. Will continue, but content may be missing.
   **** Warning: can't process font stream, loading font by the name.
Can't find CID font "Arial".
Substituting CID font /Adobe-Identity for /Arial, see doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Identity" is not provided either. Will continue, but content may be missing.
   **** Error reading a content stream. The page may be incomplete.
   **** File did not complete the page properly and may be damaged.
>>showpage, press <return> to continue<<

   **** Warning: File has unbalanced q/Q operators (too many q's)

   **** This file had errors that were repaired or ignored.
   **** The file was produced by: 
   **** >>>>  <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.
Comment 4 Ken Sharp 2011-11-11 12:17:31 UTC
(In reply to comment #3)
> What is the status of this issue? I get some similar errors when parsing a pdf
> file - see output below.

Most of these warnings are quite different and there is no final error so I do not think this is related. The initial problem is quite evident:

> Can't find CID font "Arial".
> Substituting CID font /Adobe-Identity for /Arial, 
see
> doc/Use.htm#CIDFontSubstitution.
> The substitute CID font "Adobe-Identity" is not provided either. Will continue,
> but content may be missing.

So your PDF file uses a CIDFont called 'Arial' but does not contain a copy of that font. In addition you do not have a copy of a CIDFont called Arial in your Ghostscript installation. Nor do you have the final fallback font, whose name is composed of the foundry and ordering (Adobe-Identity). So Ghostscript has to give up. 

Previously this would raise an immediate error but now the PDF interpreter attempts to continue without using the font, but it will skip large parts of the PDF file, it is not surprising to get further warnings/errors after this point.

Try installing a CIDFont called Arial, or Adobe-Identity at the very least. That may solve your problems.
Comment 5 Alex Cherepanov 2012-04-03 00:23:58 UTC
Ghostscript v.9.05 now provides fallback CID font and the file runs to
completion. Please upgrade.