Skip to content

Commit

Permalink
manual merging
Browse files Browse the repository at this point in the history
  • Loading branch information
mstamy2 committed Mar 4, 2014
2 parents b2d2bfd + f1d4882 commit 7bec1b2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,14 +1245,13 @@ def read(self, stream):
stream.seek(-1, 2)
if not stream.tell():
raise utils.PdfReadError('Cannot read an empty file')
last1K = stream.tell() - 1024 + 1
last1K = stream.tell() - 1024 + 1 # offset of last 1024 bytes of stream
line = b_('')
if debug: print(" line:",line)
while line[:5] != b_("%%EOF"):
if stream.tell() < last1K:
raise utils.PdfReadError("EOF marker not found")
line = self.readNextEndLine(stream)
if debug: print(" line:",line)
if stream.tell() < last1K:
raise utils.PdfReadError("EOF marker not found")
if debug: print(" line:",line)

# find startxref entry - the location of the xref table
line = self.readNextEndLine(stream)
Expand Down

0 comments on commit 7bec1b2

Please sign in to comment.