From 3a8265546b0fcf7efa77d01716b2d8b85c7c7f96 Mon Sep 17 00:00:00 2001 From: ffshr Date: Mon, 22 Jan 2018 19:48:39 +0100 Subject: [PATCH] fix: only calling doc.initialize() if applicable --- prsannots/pagetext.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prsannots/pagetext.py b/prsannots/pagetext.py index 0f02753..f879218 100644 --- a/prsannots/pagetext.py +++ b/prsannots/pagetext.py @@ -56,7 +56,8 @@ def get_layouts(fd): parser = PDFParser(fd) doc = new_doc(parser) - doc.initialize() + if hasattr(doc, 'initialize'): + doc.initialize() laparams = LAParams() rsrcmgr = PDFResourceManager()