-- Leo's gemini proxy
-- Connecting to aprates.dev:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
2021-10-16 | aprates.dev
> 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 `pdftk` for doing everyday things with PDF documents, two of which I experimented with: removing pages and merging files. Easy-peasy!
So, grab `pdftk` from your favorite package manager, or directly from one of the references noted bellow [2] [3], and let's get hands on by organizing those precious PDFs you have lying around :D
…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 `end` excluding the first:
pdftk original.pdf cat 2-end output result.pdf
Keep `even` pages 2, 4 and 6:
pdftk original.pdf cat 1-6 even output result.pdf
Keep `odd` pages 1, 3 and 5:
pdftk original.pdf cat 1-6 odd output result.pdf
…by labeling like A B C
pdftk A='file1.pdf' B='file2.pdf' C='file3.pdf' cat A B C output result.pdf
You get the idea!
It's a swiss army knife and can do a lot more, so maybe you want to check the `man pdftk` to unveil it's full powers.
Comment on one of my posts, talk to me, say: hello@aprates.dev
© aprates.dev, 2021-2023 - content on this site is licensed under
-- Response ended
-- Page fetched on Tue May 21 10:20:01 2024