PyPDF4
PyPDF4 copied to clipboard
ValueError: not enough values to unpack (expected 1, got 0)
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()
@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')))
Thanks @pubpub-zz, added a ticket on PyPDF2: https://github.com/py-pdf/PyPDF2/issues/1145