Skip to content

Remove everything except images #3425

Apr 30, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

That happen when the PDF was sloppily created: with text or drawings not completely inside page.rect.
For drawings, you can / should use the option that erase even when only parts are overlapping.
I believe fitz.PDF_REDACT_LINE_ART_REMOVE_IF_TOUCHED (=2).
For stubborn text, simply increase the redaction rectangle like so page.rect + (-20, -20, 20, 20) which is a rect 20 points larger in every direction.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nsklei
Comment options

@JorjMcKie
Comment options

Answer selected by nsklei
@nsklei
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants