mirror of
https://github.com/jsvine/pdfplumber.git
synced 2026-08-30 09:00:24 +08:00
add missing object type rect_edge to obj_to_edges()
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user