Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Substitute text in file .pdf with pdftk and sed

311 views
Skip to first unread message

Sandro kensan

unread,
Feb 5, 2017, 12:58:15 PM2/5/17
to
Hi,
I have read this short howto:
http://stackoverflow.com/questions/9871585/how-to-find-and-replace-text-in-a-existing-pdf-file-with-pdftk-or-other-command

Question stackoverflow:
I have on each page of my PDF document a line with this string:
%REPLACE%
Which I'd like to find and replace with another string.

Answer stackoverflow:
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

Note: This way is not successful every time, mainly due to font subsetting

***************

The problem is how to get the .pdf without font subsetting. It is easy
if I bought adobe product for pdf, but It is very expensive.

Can anyone send me -ke...@kensan.it- or upload to someplace this file
without font subsetting?

http://www.kensan.it/tmp/Volantino.pdf

Tanks a lot to everyones!

--
Sandro kensan www.kensan.it & www.qiqi.it geek site
Saluto gli agenti della NSA - Hello NSA - www.nsa.gov
0 new messages