Skip to content

Commit

Permalink
Fix #154: KeyError ‘/Contents’ on blank pages with /Contents record
Browse files Browse the repository at this point in the history
  • Loading branch information
James R. Barlow committed Apr 28, 2017
1 parent 6a91fa6 commit 6c8c1d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocrmypdf/pageinfo.py
Expand Up @@ -464,6 +464,9 @@ def _find_images(pdf, container, shorthand=None):


def _page_has_text(pdf, page):
if not '/Contents' in page:
return False

# Simple test
text = page.extractText()
if text.strip() != '':
Expand Down

0 comments on commit 6c8c1d8

Please sign in to comment.