Last active
May 25, 2022 19:42
-
-
Save knugie/9c82d8e5ecc18cf942b1 to your computer and use it in GitHub Desktop.
usefull pdftk commands
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
# merge all pdf files from a directory to a single pdf file | |
pdftk *.pdf cat output out.pdf | |
# reverse page order of a pdf file | |
PDFTK_PAGES=$(pdftk in.pdf dump_data | grep NumberOfPages | sed "s/^.*: //") | |
pdftk in.pdf cat $PDFTK_PAGES-1 output out.pdf | |
# Strip metadata in pdf | |
PDFTK_FILE=in.pdf | |
pdftk $PDFTK_FILE dump_data | sed -e 's/\(InfoValue:\)\s.*/\1\ /g' | pdftk $PDFTK_FILE update_info - output out.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment