Update pdf-clean.sh
This commit is contained in:
parent
fff852f15d
commit
3a9cde8f12
|
@ -2,13 +2,14 @@
|
|||
|
||||
set -e
|
||||
|
||||
pdftk "$1" dump_data_utf8 output meta.txt
|
||||
sed -i 's/^InfoValue:.*$/InfoValue:/g' meta.txt
|
||||
pdftk "$1" update_info meta.txt output "$1.clean.pdf"
|
||||
FILE="$1"
|
||||
CLEAN="${FILE%.pdf}.clean.pdf"
|
||||
|
||||
exiftool -q -all:all= "$1.clean.pdf"
|
||||
qpdf --linearize --replace-input "$1.clean.pdf"
|
||||
pdftk "$FILE" dump_data_utf8 |
|
||||
sed -E 's/^InfoValue:.*$/InfoValue:/g' |
|
||||
pdftk "$FILE" update_info - output "$CLEAN"
|
||||
|
||||
rm -f meta.txt "$1.clean.pdf_original"
|
||||
exiftool -q -overwrite_original -all:all= "$CLEAN"
|
||||
qpdf --linearize --replace-input "$CLEAN"
|
||||
|
||||
echo "$1.clean.pdf"
|
||||
echo "$CLEAN"
|
||||
|
|
Loading…
Reference in a new issue