Last active
January 1, 2018 12:08
-
-
Save davidfoerster/9c11bc43f896b7cbd6f9f3fc6f7d79a3 to your computer and use it in GitHub Desktop.
Decrypt PDF to PS
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
#!/bin/sh | |
INPUT=doc.pdf | |
OUTPUT=doc.ps | |
PASSWORD=foobar | |
gs -sDEVICE=pswrite -dSAFER -dBATCH -dNOPAUSE \ | |
-dColorConversionStrategy=/LeaveColorUnchanged -dDownsampleMonoImages=false -dDownsampleGrayImages=false \ | |
-dDownsampleColorImages=false -dAutoFilterColorImages=false -dAutoFilterGrayImages=false \ | |
-dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dPassThroughJPEGImages=true \ | |
-sPDFPassword="$PASSWORD" -sOutputFile="$OUTPUT" "$INPUT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment