From 3107c23245a23c122124cb4b7573018d99728606 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sat, 31 May 2014 20:01:50 -0700 Subject: [PATCH] BUG: Fixed hints to use words instead of individual glyphs. --- pdftables/pdftables.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pdftables/pdftables.py b/pdftables/pdftables.py index c043a28..2de170e 100755 --- a/pdftables/pdftables.py +++ b/pdftables/pdftables.py @@ -480,15 +480,16 @@ def hints_y(): miny = float("-inf") maxy = float("+inf") - glyphs = [glyph for glyph in box_list if glyph.text is not None] + words = make_words(box_list) + words = [word for word in words if word.text is not None] if table_top_hint: - top_box = [box for box in glyphs if table_top_hint in box.text] + top_box = [box for box in words if table_top_hint in box.text] if top_box: miny = top_box[0].top if table_bottom_hint: - bottomBox = [box for box in glyphs + bottomBox = [box for box in words if table_bottom_hint in box.text] if bottomBox: maxy = bottomBox[0].bottom