Skip to content
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

ValueError when running PdfReader.outline #1832

Closed
CactusJackFX opened this issue May 4, 2023 · 10 comments · Fixed by #1844
Closed

ValueError when running PdfReader.outline #1832

CactusJackFX opened this issue May 4, 2023 · 10 comments · Fixed by #1844

Comments

@CactusJackFX
Copy link

When I go to get the Bookmarks from this PDF I get the following error message:
ValueError: not enough values to unpack (expected 3, got 1)

I have attached a copy of the code on how I opened up the file along with the error and where numbers on where the errors where it's happening. I can't attach a copy of the PDF yet, but I will work on it.

ValueError.txt

@pubpub-zz
Copy link
Collaborator

@CactusJackFX
Can you please precise the version you are using
also if you prefer you can send the document privately to @MartinThoma [email protected]

@CactusJackFX
Copy link
Author

I'm currently using version 3.8.1. I just upgraded to that one from version 3.4.0, and I'm still getting the same error. I will work on getting approval to send you one of the two documents that I have that are currently getting that error message.

@CactusJackFX
Copy link
Author

I'm not able to provide a copy of the PDF due to PII, but I did find this when reviewing the document deeper.

image

So it might be the security is causing the issue in not reading the bookmarks.

@pubpub-zz
Copy link
Collaborator

I cannot come to any conclusion without the pdf
Subsequently I will close this issue

@pubpub-zz pubpub-zz reopened this May 10, 2023
@pubpub-zz pubpub-zz closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
@xrkk
Copy link

xrkk commented May 16, 2023

I run into this same problem. check this pdf please: https://github.com/xrkk/tmpppppp/tree/main

PyPDF2 version:3.0.1

@pubpub-zz
Copy link
Collaborator

please upgrade to pypdf and to latest update. PyPDF2 is depreciated.

@CactusJackFX
Copy link
Author

CactusJackFX commented May 16, 2023

I get the same error message on pypdf version 3.8.1 using the sample PDF that xrkk provided.

PDF Splitter Version: 1.2.3 last changed on: 05/15/2023 using PyPDF version 3.8.1.

not enough values to unpack (expected 3, got 2)
File: C:\Input\2021 ---- book - Security of biquitous Computing Systems.pdf can't read bookmarks from source pdf file.

With that sample file, this issue should be re-opened.

@pubpub-zz
Copy link
Collaborator

I've found the issue : the last parameter (zoom) in XYZ destination is optional. The code forgot that. a PR has been produced

@MartinThoma
Copy link
Member

Thank you @pubpub-zz for taking care of this issue <3

@MartinThoma
Copy link
Member

The PR was just merged and will be part of pypdf > 3.8.1. I will make the release on Sunday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants