MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_4047

Function test_4047

tests/test_annots.py:476–488  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474 assert 0, f'Failed to get expected exception.'
475
476def test_4047():
477 path = os.path.normpath(f'{__file__}/../../tests/resources/test_4047.pdf')
478 with pymupdf.open(path) as document:
479 page = document[0]
480 fontname = page.get_fonts()[0][3]
481 if fontname not in pymupdf.Base14_fontnames:
482 fontname = "Courier"
483 hits = page.search_for("|")
484 for rect in hits:
485 page.add_redact_annot(
486 rect, " ", fontname=fontname, align=pymupdf.TEXT_ALIGN_CENTER, fontsize=10
487 ) # Segmentation Fault...
488 page.apply_redactions()
489
490def test_4079():
491 path = os.path.normpath(f'{__file__}/../../tests/resources/test_4079.pdf')

Callers

nothing calls this directly

Calls 4

get_fontsMethod · 0.80
search_forMethod · 0.80
add_redact_annotMethod · 0.80
apply_redactionsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…