FAQ
Hey all, I'm trying to read a library of my company's PDFs, but about a
third of them can't be opened. PyPDF (v1.12) spits out this error:

pyPdf.utils.PdfReadError: EOF marker not found

I searched for the answer via google, but all I found was this link:
http://lindaocta.com/?tag=pypdf. She suggests fixing the problem by
appending an EOF marker like so:

def fixPdf(pdfFile):
try:
fileOpen = file(pdfFile, "a")
fileOpen.write("%%EOF")
fileOpen.close()
return "Fixed"
except Exception, e:
return "Unable to open file: %s with error: %s" % (pdfFile, str(e))

Which appears to successfully append all of the files, as the exception is
never triggered and "Fixed" always returned,
but subsequent attempts to open the files all failed. Yet all of those
files can be open successfully with Adobe Acrobat Reader.
Is this code inorrect or is there some other way to correct this error? Or
does the code depend on the system?
(I'm using Windows XP, but I believe the author was using a *nix)

Sincerely,
Brett Bowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101114/cf037c21/attachment.html>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 14, '10 at 11:30p
activeNov 14, '10 at 11:30p
posts1
users1
websitepython.org

1 user in discussion

Brett Bowman: 1 post

People

Translate

site design / logo © 2022 Grokbase