-
Notifications
You must be signed in to change notification settings - Fork 940
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
Fix #903: Keep track of OCG for LTCurve, LTLine, LTRect #924
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example of the content of the props
in do_BDC()
that you would like to use?
The There's a bit more logic needed to be done to tie these |
Thanks for the extra info. I see now why storing the OCG could be useful in some specific cases. I've been reading 8.11 (Optional Content) from the PDF Reference, but find it quite tricky to understand. Do you happen to have a PDF that has optional content groups that you can share? That would help me to understand them. As far as I understand now the properties of the |
Closing because no response. Feel free to reopen when extra info is available. |
Pull request
This PR fixes Issue 903 which was raised by me after encountering this problem.
Many vector PDFs have Optional Content Groups (OCGs), also referred to as layers. When extracting LTComponents like LTCurve, LTLine, and LTRect, one may find the need to keep track of which OCG the LTComponent is attributed to. This is accomplished by:
ocg
attributes to LTCurve, LTLine, and LTRect in 'pdfminer/layout.py'ocg
attribute in 'pdfminer/converter.py'ocg
attribute to the PDFGraphicState object in 'pdfminer/pdfinterp.py'ocg
attribute in 'pdfminer/pdfinterp.py' when the vector graphic BDC command is encountered in the PDF's stream and ensuring the currentocg
value is maintained even when the graphic state is restored with the vector graphic Q command.How Has This Been Tested?
Please remove this paragraph with a description of how this PR has been tested.
[TODO]
Checklist