Summary: | Add BMC/EMC and BDC pdfmark support | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Ken Sharp <ken.sharp> |
Component: | PDF Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | a.grahn |
Priority: | P4 | Keywords: | bountiable |
Version: | master | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Customer: | Word Size: | --- | |
Attachments: |
BDC, BMC, EMC implementation
BDC,BMC,EMC implementation test case |
Description
Ken Sharp
2014-04-11 03:10:10 UTC
Bountiable for Alexander Grahn The patches for gdevpdfm.c and gdevpdfx.h against the 9.14 sources implement BDC, BMC and EMC pdfmarks. These are necessary for the creation of optional content groups (OCGs, aka PDF layers). There is support for PDF layers in poppler-based PDF viewers, such as Evince. The BDC pdfmark accepts {object name}, even as a forward reference, as well as <<inline dict>> as the propdict argument. A Postscript test file uses BDC and EMC pdfmarks for OCGs. It covers BDC/EMC usage in the page content as well as in XObject streams. Created attachment 10821 [details]
BDC, BMC, EMC implementation
Created attachment 10822 [details]
BDC,BMC,EMC implementation
Created attachment 10823 [details]
test case
Patch adopted in commit b90e081b8ad9b64ae4b66bd27262a9582c129cfc I did add a very small change to release the memory used by the Properties resources at the end of the job. I just discovered that several files produced by pdfwrite with this change in place fail when opened with Acrobat (they can be opened with Ghostscript). I'm going to revert the commit until I can figure out why. The file attached to Bug #688000 exhibits a problem with Acrobat. It seems Acrobat doesn't like an empty Properties dictionary. Perhaps, there is something wrong with the pdf_alloc_resource(...) call in the pdfmark_BDC() function. Could you please check the argument values passed to it? (In reply to comment #9) > Perhaps, there is something wrong with the pdf_alloc_resource(...) call in > the pdfmark_BDC() function. Could you please check the argument values > passed to it? I'll try and get back to this today, I have (I think) finally got transparency in annotations detected and now working with the new FreeText annotation appearance synthesis code. It 'looks like' the marked content isn't being written properly, possibly because the file in question is an EPS and doesn't emit a showpage (it does have pdfmark operators to mark the entire content). commit 12e2eafa38a9932bb136879374423de133075a4a reinstates the patch with one very small addition to prevent us writing a duplicate (empty) object for the properties dictionary. It also addresses a bug in the ps2write header (opdfread.ps) which would cause an error if the output contained a BMC, BDC or EMC object. As far as I'm concerned this is now completed. |