Some useful commands to manipulate pdf files using pdftk

Get the latest version (that apparently is still maintained) using this command:

sudo apt install pdftk-java

Merge all pdfs in a directory:

pdftk *.pdf cat output output.pdf

Extract some pages from a pdf:

pdftk in.pdf cat 4-18 output output.pdf

pdftk in.pdf cat 5 6 10 output output.pdf

pdftk in.pdf cat 1-12 14-end output output.pdf

Last updated: 2019-12-18

Back to the front page