[ 
https://issues.apache.org/jira/browse/PDFBOX-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeremias Maerki updated PDFBOX-865:
-----------------------------------

    Attachment: PDFBOX-865-patch.diff

Attached is a patch that includes the following changes:
- Adds PD-layer classes to deal with optional content groups (OCGs, aka layers)
- Made COSArray an Iterable
- COSDocument: Allow to remove an object from the document objects
- PDPageContentStream: added some functionality from marked content (incomplete)
- PDPageContentStream Bugfix: Form XObjects were always "forgotten" when a 
second PDPageContentStream was constructed for the same page.
- PDXObjectForm: allow to set the Matrix.
- PDDocumentCatalog: allow to set the PDF version and OCProperties
- PDResources: allow to set Properties (PDPropertyList, used for marked content 
lookups)
- COSObjectKey learns Comparable
- Moved object cloning functionality from PDFMergerUtility to separate class 
PDFCloneUtility, because it's reused by LayerUtility introduced below.
- LayerUtil allows to import pages a Form XObjects and create layers with them. 
These layers can later be switched on and off through the OCG PD-layer classes. 
The code for is largely adapted from my PDF-plug-in for Apache FOP.

Design Notes:
LayerUtility is relatively close to Overlay.java but is not really the same. 
With Overlay the external pages are painted in their original size and 
position. Working with forms allows to do arbitrary transformations. Extending 
Overlay was one of my first idea but doing this with forms proved to be more 
flexible (and easier). Of course, the layer functionality could still be added 
to Overlay at some point if that's desired.

Since this adds new classes and some refactoring I submit this for review 
rather than just commit it (also because of the impending release). If someone 
does not agree on any of my design decisions, please let me know. If there's no 
feedback I'll commit after the release branch/tag has been made. Thanks!



> Optional Content Groups (OCGs aka layers): initial support
> ----------------------------------------------------------
>
>                 Key: PDFBOX-865
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-865
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: PDModel
>            Reporter: Jeremias Maerki
>            Assignee: Jeremias Maerki
>         Attachments: PDFBOX-865-patch.diff
>
>
> I'm currently writing some code for a client to create and manipulate 
> optional content groups (OCGs aka layers) on the PD-layer. The goal is to do 
> overlays in a way that the various combined pages each are on a separate 
> layer that can be switched on and off. Please note that this is only a start 
> and, for example, does not include conditional rendering of layers. I'll 
> submit a patch for review in a couple of days. I've got the necessary PD 
> layer code already and now have to upgrade the Overlay utility.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to