Skip to content

Remove text from a PDF #3049

Discussion options

You must be logged in to vote

To remove all text which is based upon regular text operations, use writer.remove_text(): https://pypdf.readthedocs.io/en/stable/modules/PdfWriter.html#pypdf.PdfWriter.remove_text

Removing all text of a specific font requires a custom implementation and more effort - see the internal implementation of writer.remove_objects_from_page() for how writer.remove_text() works. An advanced implementation would have to look into the font definitions as well.

Replies: 1 comment 3 replies

Comment options

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

@stefan6419846
Comment options

@samuelbradshaw
Comment options

Answer selected by samuelbradshaw
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