Summary: | Ghostscript decode error when opening PDF | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | gunst.pieter |
Component: | PDF Interpreter | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 9.15 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Customer: | Word Size: | --- | |
Attachments: | The PDF that fails to open. |
Description
gunst.pieter
2015-02-23 02:23:36 UTC
The PDF file has an annotation with no appearance stream. This forces Ghostscript to try and create an appearance for the annotation. In the course of this (with this file) the PDF interpreter tries to parse the DA (Default Appearance) and fails to load a colour specification, throwing an error. Technically we could do anything with an annotation which has no appearance, including doing nothing, but for a lot of them we try to draw 'seomthing'. Current code ignores the error and continues to process the file (although, obviously it doesn't draw the annotation). I do see a minor problem with the processing of colours in the DA, and that's what causes the error to be thrown. I've altered that and committed it as commit 1125d53f8db9f7402f37fa8fe7823257e4c6554a Although the prima facie cause was already fixed (so a 'worksforme would be exepcted), I'm closing this as 'fixed' because the file did highlight an underlying fault which I've corrected (thanks for reporting this by the way). The page numbering is not the problem here, its an annotation. The red grid starting 'Aannemersbedrijf' on the line 'Constructeur' has an annotation with Contents which looks like it ought to say 'Dig' (and with Acrobat, it does). However, the DA (Default Appearance) which is used to set up the graphics state for drawing the annotation does not set the font, or CTM, but does set the colour. To white..... The result of this is that when Ghostscript tries to create an appearance it draws it with an inappropriate font, and draws the text in white, so it doesn't appear. Acrobat by contrast uses the 'Rich Text' content to generate a new annotation appearance. These are XML strings and we don't support them (we are a PDF interpreter, not an XML parser), which is why our rendering is always going to be different, we follow the PDF syntax. (In reply to Ken Sharp from comment #1) Thanks for the quick and detailed response (and of course the fix :-)). |