We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
layout_mode_font_height_weight
PageObject.extract_text()
1 parent dad1788 commit 8aef4ecCopy full SHA for 8aef4ec
tests/test_text_extraction.py
@@ -219,3 +219,13 @@ def test_text_leading_height_unit():
219
page = reader.pages[0]
220
extracted = page.extract_text()
221
assert "Something[cited]\n" in extracted
222
+
223
224
+def test_layout_mode_vertical_space():
225
+ """Tests for #2915"""
226
+ reader = PdfReader(RESOURCE_ROOT / "attachment.pdf")
227
+ page = reader.pages[0]
228
+ extracted = page.extract_text(extraction_mode="layout", layout_mode_space_vertically=True,
229
+ layout_mode_font_height_weight=0.85)
230
+ assert "The Crazy Ones\nOctober 14, 1998\n\n" in extracted
231
+ assert "The round pegs in the square holes.\n\n" in extracted
0 commit comments