-
-
Notifications
You must be signed in to change notification settings - Fork 43
Error when trying to write multi-page PDF file #143
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
Comments
Can be fixed by using: merger = PdfFileMerger(strict=False) |
Have you tried merging orca pdf exports with another PDF utility e.g. https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ ? |
Yes, that seems to work fine. Although I found out that it also works if you disable |
Thanks for the reply. It sounds like orca PDF exports are ok. I'll close this issue. We aren't planning on adding multi-page (multi-graph?) exports for the moment. |
Agreed that they're "OK" and happy to have this issue closed - although looking at what's written in the issue linked in the original post, they do technically seem to be violating the PDF standard! |
I appreciate that this is not necessarily an issue with Plotly or Orca, but I'm trying to use PyPDF2 to write a multiple page PDF file, as per the following Python example:
All of the individual PDFs are written correctly, but PyPDF2 fails to merge them with the following error:
PyPDF2.utils.PdfReadError: Multiple definitions in dictionary at byte 0x8f0 for key /Type
This happens whether I write the files to disk or use an in-memory BytesIO stream.
Just wondering whether you think this is an issue with PyPDF2 or with Orca? I'm leaning towards thinking there's actually a bug in both, because PyPDF2 has this open issue: py-pdf/pypdf#325, but looking in the raw bytes of the PDF files written by Orca I can see repeated
/Type /ExtGState
lines which are maybe the root cause.I'd also be interested in being able to append a new page to a PDF document directly from Plotly/Orca so that I don't have to use another library!
The text was updated successfully, but these errors were encountered: