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: not enough values to unpack (expected 1, got 0) #1145

Closed
ms3534 opened this issue Jul 22, 2022 · 6 comments
Closed

ValueError: not enough values to unpack (expected 1, got 0) #1145

ms3534 opened this issue Jul 22, 2022 · 6 comments
Labels
needs-change The PR/issue cannot be handled as issue and needs to be improved

Comments

@ms3534
Copy link

ms3534 commented Jul 22, 2022

import os
from PyPDF4 import PdfFileReader, PdfFileMerger
from PIL import Image
from PIL import ImageFile
import argparse
import string
import collections

def png_to_pdf():
    merger = PdfFileMerger()
    merger.append(PdfFileReader(open('C:\file-0.pdf', 'rb')))

def main():
    png_to_pdf()

main()

error
file-0.pdf

@MartinThoma
Copy link
Member

@ms3534 You've shared code that uses PyPDF4. Does the issue also appear with PyPDF2? Which version of PyPDF2 have you used for testing?

@MartinThoma MartinThoma added the needs-change The PR/issue cannot be handled as issue and needs to be improved label Jul 22, 2022
@ms3534
Copy link
Author

ms3534 commented Jul 22, 2022

@MartinThoma: Yeah, the same issue is coming in PyPDF2

@ms3534
Copy link
Author

ms3534 commented Jul 22, 2022

image

@MartinThoma
Copy link
Member

Could you please execute

import PyPDF2
print(PyPDF2.__version__)

And share the results?

@MartinThoma
Copy link
Member

Oh, never mind, @pubpub-zz already confirmed that the issue also exists for a recent version :-)

pubpub-zz added a commit to pubpub-zz/pypdf that referenced this issue Jul 23, 2022
@pubpub-zz
Copy link
Collaborator

pubpub-zz commented Jul 23, 2022

@ms3534,
The problem is coming from a /FitB in a named destination with null parameters. Although accepted by the spec, it is very rare.

a fix is proposed in #1152
Also When I did further test I've noticed that with current version the text extraction on 4th page is not good (spaces) Thanks for this new sample 😀 (issue #1153)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-change The PR/issue cannot be handled as issue and needs to be improved
Projects
None yet
Development

No branches or pull requests

3 participants