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.

69 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. $ pdftk input.pdf dump_data metadata.txt
  14. 2) Edit the metadata (Geany appears to work), adding:
  15. ```
  16. InfoBegin
  17. InfoKey: Author
  18. InfoValue: Kenneth John Odle
  19. InfoBegin
  20. InfoKey: Title
  21. InfoValue: Journal #42
  22. ```
  23. (For "Title" enter whatever you want to see in the document's title bar as you read it.)
  24. 3) Update the metadata in the pdf file:
  25. $ pdft input.pdf update_info metadata.txt output.pdf
  26. Note that you must write to another file, as pdftk cannot overwrite the original file.
  27. Thus, make the file you save the scan as different than what you want the final file to be named.
  28. See https://sejh.wordpress.com/2014/11/26/changing-pdf-titles-with-pdftk/
  29. # Converting to Double Sided Scans without a Duplexer
  30. This is not an issue if your document scanner has a duplexing unit.
  31. To shuffle pages (interleave double-sided originals):
  32. Scan the front sides: 001a.pdf
  33. This gives you pages 1 3 5 7 9
  34. Scan the reverse sides: 001b.pdf
  35. This gives you pages 10 8 6 4 2
  36. $ pdftk A=001a.pdf B=001b.pdf shuffle A1-5 B5-1 output 001.pdf
  37. 001.pdf should now be in the order:
  38. 1 2 3 4 5 6 7 8 9 10
  39. See the sample files included in this repo.