-
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
Error referencing a non-existent page destination when writing PDF #2842
Comments
I'm confused about your code : what do you intend to do? I would have passed the pdf stream or better the pdf file name as the argument at PdfWriter creation |
I could not delete the font data, but here is the relevant PDF.
It does not work well. The problem is probably the content of |
Errors occur in the PDF writing process.
Environment
Which environment were you using when you encountered the problem?
Code + PDF
This is a minimal, complete example that shows the issue:
Sorry we are unable to provide the PDF.
We are in the process of confirming that we can create a PDF that can be published without any problems.
Traceback
This is the complete traceback I see:
Perhaps the following are causing the problem.
46 0 obj
and20 0 obj
do not exist.I tried to fix them in Adobe Acrobat, but could not figure out how to turn them off.
When read in PdfReader, the following will be generated in
named_destinations
. (pdf has only one page)I was able to avoid the error by adding
if len(reader.pages) > dest[“/Page”]:
on the PdfWriter side.pypdf/pypdf/_writer.py
Lines 2471 to 2482 in 8f62120
A Dests reference is created in the resulting PDF as follows.
The text was updated successfully, but these errors were encountered: