💾 Archived View for warpengineer.space › entries › password-protect-a-pdf-document.gmi captured on 2024-08-31 at 11:37:16. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

I recently had the need to add a password to a PDF file while also locking it down, but I also needed to retain the ability to edit it myself. I didn't want to use anything like Adobe's PDF application and, obviously, preferred to use Open Source and the command line. After a little bit of searching, I found that the `pdftk` tools, which I already had installed, did exactly what I needed.

$ pdftk input.pdf output output.pdf owner_pw 'password1' user_pw 'password2'

Two passwords are set: The owner's password protects the document and allows the owner to edit it. The user's password protects the document and also locks it down. Perfect.