Closed xilopaint closed 5 months ago
@xilopaint, first, note that I'm a newcomer to PyPDF4!
I'd like to confirm my interpretation of what you wrote:
Would you clarify step 2? Did you manually copy/paste changes, or did you completely overwrite the PyPDF4 files?
Would you clarify step 2? Did you manually copy/paste changes, or did you completely overwrite the PyPDF4 files?
Your interpretation is perfect and I did completely overwrite the PyPDF4 folder. You can see the attached "version" of PyPDF4 that works for me. pypdf.zip
I use pdfrw to overcome this problem for pdfs that are malformed. I never managed to make PyPDF2 3 or 4 manage this.
import pdfrw
import PyPDF4
pdf = "malformed.pdf"
x = pdfrw.PdfReader(pdf)
y = pdfrw.PdfWriter()
y.addpages(x.pages)
y.write(pdf)
pdf = PyPDF4.PdfFileReader(open(pdf, "rb"))
I have a Python 2 project that uses a PyPDF4 version prior the commits that moved the output stream argument from write() to init() in PdfFileMerger. It works fine.
After I tried to update PyPDF4 in the project to the current state, making the corresponding changes on my code regarding the output stream, I got a “EOF Marker not found” error. Here’s the traceback: