Difference between revisions of "Pdftk"
(clarifies that there is actually a graphical version that costs zero) |
|||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [https://www.pdflabs.com/ PDF Toolkit], or pdftk for short, is a great [http://fsf.org free software] command-line program for manipulating documents in the Portable Document Format (PDF). To help regular users while also supporting the author and his free software work [https://www.pdflabs.com/ PDF Labs] now also offers (graphical) desktop versions. ''' | + | [https://www.pdflabs.com/ PDF Toolkit], or pdftk for short, is a great [[http://fsf.org|free software]] command-line program for manipulating documents in the Portable Document Format (PDF). To help regular users while also supporting the author and his free software work [https://www.pdflabs.com/ PDF Labs] now also offers (graphical) desktop versions. '''Free''' will merge and split pdfs. '''Pro''' will do other processing and costs a mere $3.99. |
− | ==Manual== | + | == Manual == |
https://www.pdflabs.com/docs/pdftk-man-page/ | https://www.pdflabs.com/docs/pdftk-man-page/ | ||
− | ==Examples== | + | == Examples == |
http://www.pdflabs.com/docs/pdftk-cli-examples/ | http://www.pdflabs.com/docs/pdftk-cli-examples/ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Discard the cover page of a pdf''' | '''Discard the cover page of a pdf''' | ||
Line 20: | Line 12: | ||
</source> | </source> | ||
− | ===Collating two-sided documents=== | + | === Collating two-sided documents === |
2-sided document? No problem. Scan the original face side up first (odd pages); then flip it over and scan the second (even pages). Astute people will recognized that the second document is in reverse order compared to the first document. pdfTK can not only Merge the two documents, but '''ALSO''' can reverse the second document during collation so that the pages are in order. | 2-sided document? No problem. Scan the original face side up first (odd pages); then flip it over and scan the second (even pages). Astute people will recognized that the second document is in reverse order compared to the first document. pdfTK can not only Merge the two documents, but '''ALSO''' can reverse the second document during collation so that the pages are in order. | ||
<source lang="bash"> | <source lang="bash"> | ||
Line 27: | Line 19: | ||
In our example, We specify documents handles using 'A' and 'B' to make it easier to refer to them. The operator "shuffle" acts like "cat" but means to collate the documents like shuffling a deck of cards. Using the 'A' and 'B' handles, we can also specify a range, and by reversing the range that 'B' should be read from the "end" to "page 1" using the handle "Bend-1". | In our example, We specify documents handles using 'A' and 'B' to make it easier to refer to them. The operator "shuffle" acts like "cat" but means to collate the documents like shuffling a deck of cards. Using the 'A' and 'B' handles, we can also specify a range, and by reversing the range that 'B' should be read from the "end" to "page 1" using the handle "Bend-1". | ||
− | ===Discard blank pages=== | + | === Discard blank pages === |
If you have a scan that added blank pages (every even page), and you want to get rid of those, you would ask pdftk to 'cat' pages 1-end (but only the odd ones) and 'output' that to the file of your choice. | If you have a scan that added blank pages (every even page), and you want to get rid of those, you would ask pdftk to 'cat' pages 1-end (but only the odd ones) and 'output' that to the file of your choice. | ||
<source lang="bash"> | <source lang="bash"> | ||
pdftk ~/Desktop/DOC033115.pdf cat 1-endodd output ~/Desktop/ProofOfLearning.pdf | pdftk ~/Desktop/DOC033115.pdf cat 1-endodd output ~/Desktop/ProofOfLearning.pdf | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Tools]] | [[Category:Tools]] |
Revision as of 11:00, 31 March 2015
PDF Toolkit, or pdftk for short, is a great [software] command-line program for manipulating documents in the Portable Document Format (PDF). To help regular users while also supporting the author and his free software work PDF Labs now also offers (graphical) desktop versions. Free will merge and split pdfs. Pro will do other processing and costs a mere $3.99.
Manual[edit | edit source]
https://www.pdflabs.com/docs/pdftk-man-page/
Examples[edit | edit source]
http://www.pdflabs.com/docs/pdftk-cli-examples/
Discard the cover page of a pdf
pdftk wCover.pdf cat 2-end output NoCover.pdf
Collating two-sided documents[edit | edit source]
2-sided document? No problem. Scan the original face side up first (odd pages); then flip it over and scan the second (even pages). Astute people will recognized that the second document is in reverse order compared to the first document. pdfTK can not only Merge the two documents, but ALSO can reverse the second document during collation so that the pages are in order.
pdftk A=my.even.pdf B=my.odd.pdf shuffle A Bend-1 output my.full.pdf
In our example, We specify documents handles using 'A' and 'B' to make it easier to refer to them. The operator "shuffle" acts like "cat" but means to collate the documents like shuffling a deck of cards. Using the 'A' and 'B' handles, we can also specify a range, and by reversing the range that 'B' should be read from the "end" to "page 1" using the handle "Bend-1".
Discard blank pages[edit | edit source]
If you have a scan that added blank pages (every even page), and you want to get rid of those, you would ask pdftk to 'cat' pages 1-end (but only the odd ones) and 'output' that to the file of your choice.
pdftk ~/Desktop/DOC033115.pdf cat 1-endodd output ~/Desktop/ProofOfLearning.pdf