Skip to content

Commit 8aef4ec

Browse files
committed
TST: Add test for layout_mode_font_height_weight of PageObject.extract_text()
1 parent dad1788 commit 8aef4ec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_text_extraction.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,13 @@ def test_text_leading_height_unit():
219219
page = reader.pages[0]
220220
extracted = page.extract_text()
221221
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

Comments
 (0)