I keep this in my Scans directory, this is just a backup.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

  1. # Basic Usage
  2. To merge (concatenate) pdfs:
  3. $ pdftk inputs cat output newfile.pdf
  4. To merge all pdfs:
  5. $ pdftk *.pdf cat output newfile.pdf
  6. To break a pdf into single page files:
  7. $ pdftk input.pdf burst
  8. To combine parts of two or more files, use handles:
  9. $ pdftk A=firstfile.pdf B=secondfile.pdf cat A1-7 B1-5 A8 output newfile.pdf
  10. # Editing Metadata
  11. To edit metadata is a multistep process:
  12. 1) Dump the pdf metadata:
  13. ```
  14. $ pdftk input.pdf dump_data metadata.txt
  15. ```
  16. 2) Edit the metadata (Geany appears to work), adding:
  17. ```
  18. InfoBegin
  19. InfoKey: Author
  20. InfoValue: Kenneth John Odle
  21. InfoBegin
  22. InfoKey: Title
  23. InfoValue: Journal #42
  24. ```
  25. (For "Title" enter whatever you want to see in the document's title bar as you read it.)
  26. 3) Update the metadata in the pdf file:
  27. ```
  28. $ pdft input.pdf update_info metadata.txt output.pdf
  29. ```
  30. Note that you must write to another file, as pdftk cannot overwrite the original file.
  31. Thus, make the file you save the scan as different than what you want the final file to be named.
  32. See [https://sejh.wordpress.com/2014/11/26/changing-pdf-titles-with-pdftk/](https://sejh.wordpress.com/2014/11/26/changing-pdf-titles-with-pdftk/)
  33. # Converting to Double Sided Scans without a Duplexer
  34. This is not an issue if your document scanner has a duplexing unit.
  35. To shuffle pages (interleave double-sided originals):
  36. Scan the front sides: 001a.pdf
  37. This gives you pages 1 3 5 7 9
  38. Scan the reverse sides: 001b.pdf
  39. This gives you pages 10 8 6 4 2
  40. ```
  41. $ pdftk A=001a.pdf B=001b.pdf shuffle A1-5 B5-1 output 001.pdf
  42. ```
  43. 001.pdf should now be in the order:
  44. 1 2 3 4 5 6 7 8 9 10
  45. See the sample files included in this repo.