Summary: | PDFWrite fails on file with Error: /typecheck in --run-- | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Josh <jnankin> |
Component: | PDF Interpreter | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 9.15 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: |
file causing the bug
Fixed specimen file |
Description
Josh
2014-10-27 11:32:35 UTC
I've tried this on 9.14 and 9.15. Terminal output is from 9.14 The file fails on Ghostscript with any device, not merely pdfwrite, which would tend to indicate a problem with the PDF file itself. The PDF file is definitely broken, Acrobat displays page 3 as blank when it clearly shouldn't be. Understood. Shouldn't Ghostscript also skip the page then and finish the processing of the document? (In reply to Josh from comment #4) > Understood. Shouldn't Ghostscript also skip the page then and finish the > processing of the document? Depending on the nature of the error that may or may not be possible. Fundamentally when a PDF file doesn't conform to the specification, its wrong, and there is no defined behaviour. In general we try to do 'what Acrobat does' when we can. Created attachment 11283 [details]
Fixed specimen file
The PDF file is invalid, it contains this:
/Contents [ 46 0 R 71 0 R ]
Each entry in the Contents array must be a stream objcet, but object 46 is defined as :
46 0 obj
[ 47 0 R 48 0 R 49 0 R 50 0 R 51 0 R 52 0 R 53 0 R 54 0 R ]
endobj
Which is an array, not a stream. Since it has the wrong type, you get a typecheck error.
When I correct this, Acrobat shows page 3 with content, I mention this just to prove that the file *is* invalid.
commit cd2c4af1dd92bc4cc32170254c84498792913c0e checks the entries in the Contents array and if they aren't valid emits a warning, drops the current object and terminates the loop processing the Contents array entry (as Acrobat apparently does). You should probably tell whoever produced this file that its broken and get the authoring software (Prawn apparently) fixed. |