add missing object type rect_edge to obj_to_edges()

This commit is contained in:
Samkit Jain
2020-04-07 19:49:30 +05:30
parent dead89c86d
commit 0edc6bfadc
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -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)
+5
View File
@@ -135,6 +135,11 @@ class Test(unittest.TestCase):
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")