Joining and splitting PDFs2021-10-16 | aprates.dev
 Leia este post em português
If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. ― man pages
Today I stumbled across a nice command-line utility available for Linux, Mac and Windows, namely PDF Tool Kit, packaged under codename
pdftkfor doing everyday things with PDF documents, two of which I experimented with: removing pages and merging files. Easy-peasy!
pdftkfrom your favorite package manager, or directly from one of the references noted bellow  , and let's get hands on by organizing those precious PDFs you have lying around :D
Removing Pages…by selecting the pages you want to keep!
- Keep only page 5:
pdftk original.pdf cat 5 output result.pdf
- Keep pages 6 3 4 in this exact order:
pdftk original.pdf cat 6 3 4 output result.pdf
- Keep first 5 pages:
pdftk original.pdf cat 1-5 output result.pdf
- Keep the pages to the
endexcluding the first:
pdftk original.pdf cat 2-end output result.pdf
evenpages 2, 4 and 6:
pdftk original.pdf cat 1-6 even output result.pdf
oddpages 1, 3 and 5:
pdftk original.pdf cat 1-6 odd output result.pdf
Merging Files…by labeling like A B C
pdftk A='file1.pdf' B='file2.pdf' C='file3.pdf' cat A B C output result.pdfYou get the idea!
Power HacksIt's a swiss army knife and can do a lot more, so maybe you want to check the
man pdftkto unveil it's full powers.
References Original pdftk under GPL
 Java port of pdftk under GPL
See also Capsule Archives
 Capsule Home
Want more?Comment on one of my posts, talk to me, say:
/msg aprateson irc.libera.chat
 Subscribe to the Capsule's Feed
 Checkout my projects on GitHub
 Checkout my projects on SourceHut
Join GeminispaceGemini is a new Internet protocol introduced in 2019, as an alternative to http(s) or gopher, for lightweight text contents and better privacy.
Not sure how, but want to be part of the club? See:
 Gemini quick start guide
Already have a Gemini client?
 Navigate this capsule via Gemini
© aprates.dev, 2021 - content on this site is licensed under
 Creative Commons BY-NC-SA 4.0 License
 Proudly built with GemPress