Skip to content

Commit

Permalink
Fix ValueError when text is out of visible page
Browse files Browse the repository at this point in the history
  • Loading branch information
minhyeoky committed Oct 5, 2022
1 parent 3df0e65 commit 4bdfc25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions camelot/parsers/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def _text_bbox(t_bbox):
Tuple (x0, y0, x1, y1) in pdf coordinate space.
"""
if all(len(t) == 0 for direction in t_bbox for t in t_bbox[direction]):
return (0, 0, 0, 0)

xmin = min([t.x0 for direction in t_bbox for t in t_bbox[direction]])
ymin = min([t.y0 for direction in t_bbox for t in t_bbox[direction]])
xmax = max([t.x1 for direction in t_bbox for t in t_bbox[direction]])
Expand Down

0 comments on commit 4bdfc25

Please sign in to comment.