Skip to content
Snippets Groups Projects
Commit f6381680 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Better handling of malformed pdf

parent b84f73c5
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,9 @@ class PDFParser(abstract.AbstractParser): ...@@ -84,6 +84,9 @@ class PDFParser(abstract.AbstractParser):
for pagenum in range(pages_count): for pagenum in range(pages_count):
page = document.get_page(pagenum) page = document.get_page(pagenum)
if page is None:
logging.error("Unable to get PDF pages")
return False
page_width, page_height = page.get_size() page_width, page_height = page.get_size()
logging.info("Rendering page %d/%d", pagenum + 1, pages_count) logging.info("Rendering page %d/%d", pagenum + 1, pages_count)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment