Skip to content

Instantly share code, notes, and snippets.

@riddla
Created June 11, 2019 11:23
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 riddla/2e8d5785801a79289cb4ee2b3ddba7dd to your computer and use it in GitHub Desktop.
Save riddla/2e8d5785801a79289cb4ee2b3ddba7dd to your computer and use it in GitHub Desktop.
remove password from pdf file using ghostscript
# Ghostscript command to remove the password from an encrypted pdf document.
# Replace ENCRYPTED.pdf with the path to your password protected pdf file.
# The unencrypted file is created as OUTPUT.pdf in the same directory.
# Install Ghostscript on the Mac with brew install gs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f ENCRYPTED.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment