Skip to content

Commit

Permalink
add missing object type rect_edge to obj_to_edges()
Browse files Browse the repository at this point in the history
  • Loading branch information
samkit-jain committed Apr 7, 2020
1 parent dead89c commit 0edc6bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pdfplumber/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def obj_to_edges(obj):
return {
"line": lambda x: [ line_to_edge(x) ],
"rect": rect_to_edges,
"rect_edge": rect_to_edges,
"curve": curve_to_edges,
}[obj["object_type"]](obj)

Expand Down
5 changes: 5 additions & 0 deletions tests/test-issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ def test_pr_138(self):
with pdfplumber.open(path) as pdf:
page = pdf.pages[0]
assert len(page.chars) == 5140
page.extract_tables({
"vertical_strategy": "explicit",
"horizontal_strategy": "lines",
"explicit_vertical_lines": page.curves + page.edges,
})

def test_issue_140(self):
path = os.path.join(HERE, "pdfs/issue-140-example.pdf")
Expand Down

0 comments on commit 0edc6bf

Please sign in to comment.