Test for keeping text and removing graphics.
()
| 182 | |
| 183 | |
| 184 | def test_redact2(): |
| 185 | """Test for keeping text and removing graphics.""" |
| 186 | if not hasattr(pymupdf, "mupdf"): |
| 187 | print("Not executing 'test_redact2' in classic") |
| 188 | return |
| 189 | filename = os.path.join(scriptdir, "resources", "symbol-list.pdf") |
| 190 | doc = pymupdf.open(filename) |
| 191 | page = doc[0] |
| 192 | all_text0 = page.get_text("words") |
| 193 | page.add_redact_annot(page.rect) |
| 194 | page.apply_redactions(text=1) |
| 195 | t = page.get_text("words") |
| 196 | assert t == all_text0 |
| 197 | assert not page.get_drawings() |
| 198 | |
| 199 | |
| 200 | def test_redact3(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…