Skip to content

Commit

Permalink
TST: Add test for layout_mode_font_height_weight of ``PageObject.…
Browse files Browse the repository at this point in the history
…extract_text()``
  • Loading branch information
hpierre001 committed Oct 22, 2024
1 parent dad1788 commit 22c82e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_text_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,13 @@ def test_text_leading_height_unit():
page = reader.pages[0]
extracted = page.extract_text()
assert "Something[cited]\n" in extracted


def test_layout_mode_vertical_space():
"""Tests for #2915"""
reader = PdfReader(RESOURCE_ROOT / "attachment.pdf")
page = reader.pages[0]
extracted = page.extract_text(extraction_mode='layout', layout_mode_space_vertically=True,
layout_mode_font_height_weight=0.85)
assert "The Crazy Ones\nOctober 14, 1998\n\n" in extracted
assert "The round pegs in the square holes.\n\n" in extracted

0 comments on commit 22c82e2

Please sign in to comment.