Skip to content

Is setting garbage=3 in Document.save necessary for Page.apply_redaction to fully remove information? #3836

Answered by JorjMcKie
Kyrylo-Hrytsenko asked this question in Q&A
Discussion options

You must be logged in to vote

Changing / Deleting objects in a PDF always and inevitably means disabling old objects.
Physical removal of these zombie objects only ever happens with garbage collection.
This is a restriction or peculiarity of the PDF design - not anything specific to (Py-) MuPDF.

If you read the documentation for garbage collection, you will find that garbage collection 1 removes unused objects. "Unused" means that no reference to the object is found. "Removal" means that the object will physically no longer be present on the created output. The XREF table afterwards will contain holes (unused array items) which previously have pointed to no gone objects.
If you want to do the minimal required thing, t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kyrylo-Hrytsenko
Comment options

Answer selected by Kyrylo-Hrytsenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants