🖥️pdftk
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the pdftk command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██████╗ ███████╗████████╗██╗ ██╗
# ██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██║ ██╔╝
# ██████╔╝██║ ██║█████╗ ██║ █████╔╝
# ██╔═══╝ ██║ ██║██╔══╝ ██║ ██╔═██╗
# ██║ ██████╔╝██║ ██║ ██║ ██╗
# ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
# Concatenate all pdf files into one:
pdftk *.pdf cat output all.pdf
# Concatenate specific pdf files into one:
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
# Concatenate pages 1 to 5 of first.pdf with page 3 of second.pdf
pdftk A=fist.pdf B=second.pdf cat A1-5 B3 output new.pdf
# Cut select pages from a pdf file and create a new file from those pages.
pdftk input.pdf cat 2-4 7 9-10 output output.pdf
# Explanation:
# pdftk is the PDF Toolkit
# input.pdf is the input file.
# cat 2-4 7 9-10 concatenate (combine) pages 2,3,4,7,9,10 of input.pdf.
# output output.pdf the resulting pdf file containing the above pages.
## Alternative one-liners:
# Cut select pages from a pdf file and create a new file from those pages.
ps2pdf -dFirstPage=3 -dLastPage=10 input.pdf output.pdf
# Explanation: ps2pdf is a script that comes with Ghostscript - despite the name, it can accept PDF files as input, not just postscript files.
# Limitations: Only a single contiguous range of pages can be specified.
#==============================##==============================#
# CMD PDFTK #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command pdftk in a clear format. This allows users to quickly access the needed information for pdftk without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for pdftk are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.