Summary: | Nested form XObject pdfmarks not working properly | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Ken Sharp <ken.sharp> |
Component: | PDF Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | christinedelight.top85, shailesh.mistry |
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Windows NT | ||
Customer: | Word Size: | --- | |
Attachments: |
patch for base/gdevpdfm.c to fix issue with /SP/BP/EP pdfmarks nested between /BP /EP pdfmarks
patch for nested form XObject pdfmarks PDF file, produced from testfile given above using patched version of gs (patch=attachment 6857) |
Description
Ken Sharp
2008-01-15 05:24:30 UTC
Created attachment 6833 [details] patch for base/gdevpdfm.c to fix issue with /SP/BP/EP pdfmarks nested between /BP /EP pdfmarks IF /SP pdfmark is injected into the definition of a new Form XObject (that is, put between /BP-/EP pdfmarks), the newly created container Form XObject lacks the /XObject entry in its /Resources dictionary. The proposed patch fixes this bug. It maintains a stack of dictionaries which are filled with the XObject resources referenced in the current context, that is which are referenced (by /SP pdfmark) in the content stream of the Form XObject currently open (opened by the /BP pdfmark). When the current context is closed by an /EP pdfmark the /XObject entry is added to the /Resources dictionary. Hence, /BP-/EP and /SP can now be nested to arbitrary depth into other /BP-/EP pdfmark pairs. The patch also fixes bug 689883. Created attachment 6857 [details] patch for nested form XObject pdfmarks The updated patch is much shorter. A correct PDF will be produced from the given Postscript example. Also fixes bug 689883. Created attachment 6862 [details] PDF file, produced from testfile given above using patched version of gs (patch=attachment 6857 [details]) Bug still reproducible in Ghostscript 9.03 Patch (finally!) adopted in commit 3d544d51c3e1d63a2fd115dac23255c966ba0e Apologies for the length of time its taken to review and adopt this. |