Last active
June 11, 2019 02:34
-
-
Save skishida/ef5290527cf2637fa7402a98325aca87 to your computer and use it in GitHub Desktop.
decrypt edit-locked pdf and unlock view-locked pdf with ghost script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function decrypt-pdf() { | |
command ghostscript -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=${1%.*}-dec.pdf -c .setpdfwrite -f $1 | |
} | |
function unlock-pdf() { | |
command ghostscript -q -dNOPAUSE -dBATCH -sPDFPassword=$2 -sDEVICE=pdfwrite -sOutputFile=${1%.*}-dec.pdf -c .setpdfwrite -f $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment