Skip to content

Instantly share code, notes, and snippets.

@mallendeo
Last active January 4, 2021 06:20
Show Gist options
  • Save mallendeo/6f449d1a4fe1de269ae0d58576edffb4 to your computer and use it in GitHub Desktop.
Save mallendeo/6f449d1a4fe1de269ae0d58576edffb4 to your computer and use it in GitHub Desktop.
Remove PDF protection using Ghostscript

Remove the owner password from an encrypted PDF using Ghostscript

Note: you still need to know the password for opening the file

brew install ghostscript # on macOS
gs -q -dNOPAUSE -dBATCH -dPrinted=true -dShowAnnots=false -sDEVICE=pdfwrite -sPDFPassword=YOUR_PDF_PASSWORD -sOutputFile=unlocked.pdf -f locked.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment