Bug 692583 - Missing CID font causes output to be missing all content
Summary: Missing CID font causes output to be missing all content
Status: NOTIFIED DUPLICATE of bug 690779
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Text (show other bugs)
Version: master
Hardware: PC All
: P1 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 15:46 UTC by Marcos H. Woehrmann
Modified: 2011-11-09 18:19 UTC (History)
0 users

See Also:
Customer: 850
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2011-10-11 15:46:15 UTC
The customer reports and I've verified that Ghostscript 9.04 (and master) generate a completely blank page when rendering the attached PDF file to a bitmap.  The file references a CID font that is not embedded and Ghostscript does produce the warning: 

The substitute CID font "Adobe-Identity" is not provided either. Will continue, but content may be missing.

But most of the content of the file is not text, so generating an entire blank output page is wrong.

If I add an entry to the cidfmap file the file is rendered correctly:

/Arial << /FileType /TrueType /Path (./arial.ttf) /SubfontID 0 /CSI [(Identity) 0] >> ;


The command line I'm using for testing:

  bin/gs -sDEVICE=ppmraw -o test.ppm ./58852.pdf



BTW, while addressing this issue could you also fix the repeated warnings produced by this file:

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.
Comment 2 Ken Sharp 2011-10-11 16:20:46 UTC
This is another in the long series of 'wouldn't it be nice if we could substitute for missing CIDFonts'.

Chris is working on it (I forget the current bug #), in the meantime I suggest sending the customer my long treatise on what to do about this problem.

As always, there is no real bug, no font = can't render. Previously (and still if you set -dPDFSTOPONERROR) you would get an error and GS would stop.
Comment 3 Marcos H. Woehrmann 2011-10-11 21:07:04 UTC
(In reply to comment #2)
> This is another in the long series of 'wouldn't it be nice if we could
> substitute for missing CIDFonts'.
> 

This is file is not in that category.  The majority of the data is not text, we should be able to render nearly all of the file even without the font.  Certainly that's what the warning Ghostsript produces implies.
Comment 4 Ken Sharp 2011-10-12 06:55:26 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > This is another in the long series of 'wouldn't it be nice if we could
> > substitute for missing CIDFonts'.
> > 
> 
> This is file is not in that category.  The majority of the data is not text, we
> should be able to render nearly all of the file even without the font. 

If the content stream raises an error then the PDF interpreter stops reading that content stream. Anything later in the stream will not appear. If there are multiple content streams and the later ones do not contain offending text, then that content may appear because we carry on reading later streams. Also, of course, anything prior to the offending text will appear.

Caveat; recently I've seen a lot of files with multiple content streams where the new stream depends on the content of the previous one, these are very likely to error out themselves because we didn't finish the previous stream....

You say yourself in comment #0 that adding a font as a replacement causes the file to render correctly, so it *must* be the problem.


> Certainly that's what the warning Ghostsript produces implies.

The warning says content may be missing, I'm not sure how we can be more explicit.
Comment 5 Chris Liddell (chrisl) 2011-10-12 08:35:20 UTC
FWIW, the code I've got in development successfully rips this file, but isn't really ready for "prime time" use. I'm planning on this *enhancement* being ready for 9.05.

I'm tracking this under 690779, and this customer is already listed for that issue.

*** This bug has been marked as a duplicate of bug 690779 ***