Edit: WIP for now, it should be optional, maybe in settings dialog or something else.
I implemented custom removal of graphics (vector drawings) using pypdf library when points are found within redaction rectangles.
This tries to remove drawings with any of the following properties from the page (on top of the redaction from PyMuPDF):
- the drawing is fully covered by a redaction
- any rectangle of the graphic is fully covered by a redaction
- any curve, line, or quadruple has a point covered by a redaction
- if the drawing has no item (curve, line, etc.) and intersects with a redaction
It by decision keeps a drawing even if its rectangle(s) have some intersection with redaction rectangles.
Only after this implementation, I understood that the original issue was that pymupdf.PDF_REDACT_LINE_ART_REMOVE_IF_TOUCHED was not applied because of a documentation issue. It is now applied if the custom removal fails.
Related: #5, !115
Edit: WIP for now, it should be optional, maybe in settings dialog or something else.
I implemented custom removal of graphics (vector drawings) using pypdf library when points are found within redaction rectangles.
This tries to remove drawings with any of the following properties from the page (on top of the redaction from PyMuPDF):
- the drawing is fully covered by a redaction
- any rectangle of the graphic is fully covered by a redaction
- any curve, line, or quadruple has a point covered by a redaction
- if the drawing has no item (curve, line, etc.) and intersects with a redaction
It by decision keeps a drawing even if its rectangle(s) have some intersection with redaction rectangles.
Only after this implementation, I understood that the original issue was that `pymupdf.PDF_REDACT_LINE_ART_REMOVE_IF_TOUCHED` was not applied because of a [documentation issue](https://github.com/pymupdf/PyMuPDF/issues/4924). It is now applied if the custom removal fails.
Related: #5, !115