Description
Redacting the full page of a file with annotations, unexpectedly did not remove the annotations:
| original | redacted |
|---|---|
| image | image |
Sample file from: https://github.com/py-pdf/sample-files/tree/main/024-annotations
Implementation
Remove also annotations ...
Pseudocode:
for annot in page.annots:
if redaction.intersection(annot.sect) is not None:
document.remove(annot.xref)
See https://pymupdf.readthedocs.io/en/latest/page.html#Page.annots, https://pymupdf.readthedocs.io/en/latest/annot.html#Annot.rect
(works with point annotations?)
Related upstream issue
If sanitization from !117 is used: https://github.com/pymupdf/PyMuPDF/issues/4928
Further elements to redact
- widgets
- form entries?
- signatures (see #98)
- ...?
## Description
Redacting the full page of a file with annotations, unexpectedly did not remove the annotations:
original|redacted
---|---
|
Sample file from: https://github.com/py-pdf/sample-files/tree/main/024-annotations
## Implementation
Remove also annotations ...
Pseudocode:
```py
for annot in page.annots:
if redaction.intersection(annot.sect) is not None:
document.remove(annot.xref)
```
See https://pymupdf.readthedocs.io/en/latest/page.html#Page.annots, https://pymupdf.readthedocs.io/en/latest/annot.html#Annot.rect
(works with point annotations?)
## Related upstream issue
If sanitization from !117 is used: https://github.com/pymupdf/PyMuPDF/issues/4928
## Further elements to redact
- widgets
- form entries?
- signatures (see #98)
- ...?