Skip to content

Commit b02c92f

Browse files
tests/: added test_4944(), reproducer for #4944.
1 parent 0de7f18 commit b02c92f

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

tests/resources/test_4944.pdf

10.5 KB
Binary file not shown.

tests/test_annots.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,3 +718,24 @@ def draw_rectangle(rect, c, w):
718718
document.save(path_out)
719719
print(f' {path=}.')
720720
print(f'{path_out=}.')
721+
722+
723+
def test_4944():
724+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4944.pdf')
725+
path_out = os.path.normpath(f'{__file__}/../../tests/test_4944_out.pdf')
726+
print()
727+
with pymupdf.open(path) as document:
728+
page = document[0]
729+
print(f'{page.rotation=}')
730+
print(f'{page.rotation_matrix=}')
731+
print(f'{page.transformation_matrix=}')
732+
text_json = page.get_text('rawjson')
733+
#print(text_json)
734+
735+
page.add_redact_annot(page.rect)
736+
page.apply_redactions(text=pymupdf.PDF_REDACT_TEXT_REMOVE)
737+
document.save(path_out)
738+
print(repr(page.get_text()))
739+
740+
text_json = page.get_text('rawjson')
741+
#print(text_json)

0 commit comments

Comments
 (0)