-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Optional Content Groups #92
Comments
Thanks - We definitely need support for layered PDFs to display correctly (and possibly support for adding/removing layers? |
It looks like the OCG settings are stored in the 'OCProperties' dictionary in 'Root' - see dump below. The problem here is that it uses IndirectObjects, which don't necessarily have the same ID in the input PDF to the output PDF when the page is appended. How do we get the ID of the corresponding new object in the output PDF?
|
How did you get the dumped structure? |
@emmama1234 I've got the dumped structure like this: from PyPDF2 import PdfFileReader
reader = PdfFileReader(file('test.pdf','rb'))
reader.trailer['/Root']['/OCProperties'] |
@snorfalorpagus did you find any way to add/remove OCG layers to multiple pages Pdf with PyPDF2? |
I didn't get any further than viewing the data as posted above. :( |
@snorfalorpagus Thanks! i'll take a look at it to see if i can find something |
As this feature request didn't receive an update for a long time, I'm closing it. I'm linking it in #1181 so that we don't forget about it. Please feel free to add more information (PDFs that use it; other projects that implement it; explanations how it would improve PyPDF2) |
PyPDF2 does not currently have any support for Optional Content Groups (OCGs). When merging multiple documents into a single document the layers are effectively
flattened and functionality is lost.
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
4.10.2 Making Graphical Content Optional
The text was updated successfully, but these errors were encountered: