Skip to content

Instantly share code, notes, and snippets.

@kevcjones-archived
Last active June 20, 2022 02:19
Show Gist options
  • Save kevcjones-archived/4483127 to your computer and use it in GitHub Desktop.
Save kevcjones-archived/4483127 to your computer and use it in GitHub Desktop.
Unlocking a PDF using ghostscript
required - install ghost script - e.g brew install ghostscript (takes a few minutes)
update this line as needed and run in terminal
-- New and updated thanks to comments --
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -SPDFPassword=THE_PASSWORD -sOutputFile=unencrypted.pdf -c .setpdfwrite -f 2017-06-13-11-55-56-188_14972345156188_XXXPT6345X_ITRV.pdf
-- Original --
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
@mustaqimM
Copy link

mustaqimM commented Dec 5, 2019

@denysvega Thank you so much for your comment. It's the only one that works

@alexsmithbr
Copy link

Exactly what @mustaqimM said. Thanks, @denysvega! Worked for me too.

@kevcjones-archived
Copy link
Author

I've updated the original gist now - cheers @denysvega

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