claird / PyPDF4

A utility to read and write PDFs with Python
obsolete-https://pythonhosted.org/PyPDF2/
Other
328 stars 61 forks source link

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

Open ms3534 opened 1 year ago

ms3534 commented 1 year ago

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

pubpub-zz commented 1 year ago

@ms3534 , PyPDF4 is no more active whereas PyPDF2 is. I've tried your test file in PyPDF2 and the error is confirmed there too. I will analyze the issue and try to produce a fix ; to do that can you duplicate the issue in https://github.com/py-pdf/PyPDF2 ?

also this code is a minimized test version

from PyPDF2 import PdfFileReader, PdfFileMerger
merger = PdfFileMerger()
merger.append(PdfFileReader(open('C:\file-0.pdf', 'rb')))
ms3534 commented 1 year ago

Thanks @pubpub-zz, added a ticket on PyPDF2: https://github.com/py-pdf/PyPDF2/issues/1145