()
| 363 | |
| 364 | |
| 365 | def test_2108(): |
| 366 | doc = pymupdf.open(f'{scriptdir}/resources/test_2108.pdf') |
| 367 | page = doc[0] |
| 368 | areas = page.search_for("{sig}") |
| 369 | rect = areas[0] |
| 370 | page.add_redact_annot(rect) |
| 371 | page.apply_redactions() |
| 372 | text = page.get_text() |
| 373 | |
| 374 | text_expected = b'Frau\nClaire Dunphy\nTeststra\xc3\x9fe 5\n12345 Stadt\nVertragsnummer: 12345\nSehr geehrte Frau Dunphy,\nText\nMit freundlichen Gr\xc3\xbc\xc3\x9fen\nTestfirma\nVertrag:\n 12345\nAnsprechpartner:\nJay Pritchet\nTelefon:\n123456\nE-Mail:\ntest@test.de\nDatum:\n07.12.2022\n'.decode('utf8') |
| 375 | |
| 376 | if 1: |
| 377 | # Verbose info. |
| 378 | print(f'test_2108(): text is:\n{text}') |
| 379 | print(f'') |
| 380 | print(f'test_2108(): repr(text) is:\n{text!r}') |
| 381 | print(f'') |
| 382 | print(f'test_2108(): repr(text.encode("utf8")) is:\n{text.encode("utf8")!r}') |
| 383 | print(f'') |
| 384 | print(f'test_2108(): text_expected is:\n{text_expected}') |
| 385 | print(f'') |
| 386 | print(f'test_2108(): repr(text_expected) is:\n{text_expected!r}') |
| 387 | print(f'') |
| 388 | print(f'test_2108(): repr(text_expected.encode("utf8")) is:\n{text_expected.encode("utf8")!r}') |
| 389 | |
| 390 | ok1 = (text == text_expected) |
| 391 | ok2 = (text.encode("utf8") == text_expected.encode("utf8")) |
| 392 | ok3 = (repr(text.encode("utf8")) == repr(text_expected.encode("utf8"))) |
| 393 | |
| 394 | print(f'') |
| 395 | print(f'ok1={ok1}') |
| 396 | print(f'ok2={ok2}') |
| 397 | print(f'ok3={ok3}') |
| 398 | |
| 399 | print(f'') |
| 400 | |
| 401 | print(f'{pymupdf.mupdf_version_tuple=}') |
| 402 | print('Asserting text==text_expected') |
| 403 | assert text == text_expected |
| 404 | |
| 405 | |
| 406 | def test_2238(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…