Skip to content

Commit e0c2b2e

Browse files
tests: added test_4363().
1 parent a179072 commit e0c2b2e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tests/resources/test_4363.pdf

757 KB
Binary file not shown.

tests/test_textextract.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,35 @@ def test_extendable_textpage():
780780

781781
path3 = os.path.normpath(f'{__file__}/../../tests/test_extendable_textpage3.pdf')
782782
document.save(path3)
783+
784+
785+
def test_4363():
786+
print()
787+
print(f'{pymupdf.version=}')
788+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4363.pdf')
789+
n = 0
790+
texts = list()
791+
with pymupdf.open(path) as document:
792+
assert len(document) == 1
793+
page = document[0]
794+
t = page.search_for('tour')
795+
print(f'{t=}')
796+
n += len(t)
797+
text = page.get_text()
798+
texts.append(text)
799+
print(f'{n=}')
800+
print(f'{len(texts)=}')
801+
text = texts[0]
802+
print('text:')
803+
print(f'{text=}')
804+
text_expected = (
805+
'Deal Roadshow SiteTour\n'
806+
'We know your process. We know your standard.\n'
807+
'Professional Site Tour Video Productions for the Capital Markets.\n'
808+
'1\n'
809+
)
810+
if text != text_expected:
811+
print(f'Expected:\n {text_expected!r}')
812+
print(f'Found:\n {text!r}')
813+
assert 0
814+

0 commit comments

Comments
 (0)