Skip to content

Commit

Permalink
Have .extract_words(...) include doctop in attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvine committed Nov 3, 2021
1 parent 02e98ae commit 66fef89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pdfplumber/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def __init__(self, **settings):

def merge_chars(self, ordered_chars):
x0, top, x1, bottom = objects_to_bbox(ordered_chars)
doctop_adj = ordered_chars[0]["doctop"] - ordered_chars[0]["top"]
upright = ordered_chars[0]["upright"]

direction = 1 if (self.horizontal_ltr if upright else self.vertical_ttb) else -1
Expand All @@ -240,6 +241,7 @@ def merge_chars(self, ordered_chars):
"x0": x0,
"x1": x1,
"top": top,
"doctop": top + doctop_adj,
"bottom": bottom,
"upright": upright,
"direction": direction,
Expand Down

0 comments on commit 66fef89

Please sign in to comment.