Last active
March 3, 2020 03:06
-
-
Save tnibert/aac22948e18367af4ad509c01c79c36f to your computer and use it in GitHub Desktop.
PDF shell manipulations
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
# this is a work in progress notepad, will include pdftk and ghostscript stuff | |
# replace page 13 of doc1.pdf with doc2.pdf | |
pdftk A=doc1.pdf B=doc2.pdf cat A1-12 B1 A14-end output out1.pdf | |
# remove the first 4 pages from in.pdf | |
pdftk A=in.pdf cat A5-end output out.pdf | |
# use ghostscript to combine PDFs | |
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=finished.pdf file1.pdf file2.pdf file3.pdf | |
# use ghostscript to split a PDF by page | |
# only works with gs version 9.06+ | |
gs -sDEVICE=pdfwrite -dSAFER -o outname.%d.pdf input.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment