Last active
May 5, 2017 17:02
-
-
Save z38/5869271 to your computer and use it in GitHub Desktop.
Strip PDF metadata using PDFtk
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 | |
set -e | |
pdftk "$1" dump_data output "$1.metadata" | |
sed -e 's/InfoValue: .*/InfoValue:/' < "$1.metadata" > "$1.metadata-stripped" | |
cp "$1" "$1.bak" | |
pdftk "$1.bak" update_info "$1.metadata-stripped" output "$1" | |
rm "$1.metadata" "$1.metadata-stripped" "$1.bak" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment