Skip to content

Commit

Permalink
Fix for when 'trailer' is indented
Browse files Browse the repository at this point in the history
  • Loading branch information
jstockwin committed Sep 29, 2020
1 parent 0b44f77 commit b0f86ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Rename PDFTextExtractionNotAllowedError to PDFTextExtractionNotAllowed to revert breaking change ([#461](https://github.com/pdfminer/pdfminer.six/pull/461))
- Always try to get CMap, not only for identity encodings ([#438](https://github.com/pdfminer/pdfminer.six/pull/438))
- Fix a bug where 'trailer' being indented caused issues ([#513](https://github.com/pdfminer/pdfminer.six/pull/513))

## [20200720]

Expand Down
2 changes: 1 addition & 1 deletion pdfminer/pdfdocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def load(self, parser):
raise PDFNoValidXRef('Unexpected EOF - file corrupted?')
if not line:
raise PDFNoValidXRef('Premature eof: %r' % parser)
if line.startswith(b'trailer'):
if line.strip().startswith(b'trailer'):
parser.seek(pos)
break
f = line.strip().split(b' ')
Expand Down

0 comments on commit b0f86ca

Please sign in to comment.