Test for removing text and keeping graphics.
()
| 212 | |
| 213 | |
| 214 | def test_redact4(): |
| 215 | """Test for removing text and keeping graphics.""" |
| 216 | if not hasattr(pymupdf, "mupdf"): |
| 217 | print("Not executing 'test_redact4' in classic") |
| 218 | return |
| 219 | filename = os.path.join(scriptdir, "resources", "symbol-list.pdf") |
| 220 | doc = pymupdf.open(filename) |
| 221 | page = doc[0] |
| 222 | line_art = page.get_drawings() |
| 223 | page.add_redact_annot(page.rect) |
| 224 | page.apply_redactions(graphics=0) |
| 225 | assert not page.get_text("words") |
| 226 | assert line_art == page.get_drawings() |
| 227 | |
| 228 | |
| 229 | def test_1645(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…