Skip to content

Instantly share code, notes, and snippets.

@antonkratz
Last active June 28, 2023 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonkratz/0ff4d9f9cce5ec457654937108e31d07 to your computer and use it in GitHub Desktop.
Save antonkratz/0ff4d9f9cce5ec457654937108e31d07 to your computer and use it in GitHub Desktop.
readact, flatten, PDF, Ubuntu

There is a sensitive document. Credit card statements. Reimbursement.

I want to redact (hide) parts of the document.

  1. Create a pitch black highlighter pen in Okular. Highlight the relevant text in black.
  2. The text is still there and can easily be seen, for example by highlighting (in the sense of Ctrl-A) the entire document.
  3. To flatten = actually remove the text beneath the black highlights:

pdf2ps in.pdf - | ps2pdf - out.pdf

Other suggestions (convert, ghostview...) do not work. Broken images, missing pages, weird fonts...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment