Add width & height kwargs to .to_image() #798

This commit is contained in:
Jeremy Singer-Vine
2023-02-13 18:49:18 -05:00
parent c4e1b294bb
commit 93f7dbd1a2
4 changed files with 38 additions and 6 deletions
+11
View File
@@ -34,6 +34,17 @@ class Test(unittest.TestCase):
self.im.draw_vlines([10])
self.im.draw_hlines([10])
def test_width_height(self):
p = self.pdf.pages[0]
with pytest.raises(ValueError):
p.to_image(resolution=72, height=100)
im = p.to_image(width=503)
assert im.original.width == 503
im = p.to_image(height=805)
assert im.original.height == 805
def test_debug_tablefinder(self):
self.im.reset()
settings = {"horizontal_strategy": "text", "intersection_tolerance": 5}