Thursday 16 July 2015

PDF join files and replace strings using pdftk

pdftk *.pdf cat output combined.pdf
 ===========

You can try to modify content of your PDF as follows
  1. Uncompress the text streams of PDF
    pdftk file.pdf output uncompressed.pdf uncompress
  2. Use sed to replace your text with another
    sed -e "s/ORIGINALSTRING/NEWSTRING/g" <uncompressed.pdf >modified.pdf
  3. If this attempt was successful, re-compress the PDF with pdftk
    pdftk modified.pdf output recompressed.pdf compress


Sources:
https://www.pdflabs.com/docs/pdftk-cli-examples/
http://stackoverflow.com/a/9872494/4151875

No comments:

Post a Comment