Recently I had to remove a footer from a pdf document, as the document is over
100 pages and I need to do this on a monthly basis manual editing was not an option (oh and I am waaaay to lazy to do it manually)
After some research the following command line options worked like a charm:
Install qpdf and pdftk:
Uncompress the pdf document:
Then remove the text (footer) with the following sed:
And lastly repair the pdf and compress it again.
remember to clean up and remove all the interim files.
100 pages and I need to do this on a monthly basis manual editing was not an option (oh and I am waaaay to lazy to do it manually)
After some research the following command line options worked like a charm:
Install qpdf and pdftk:
sudo apt-get install qpdf pdftk
Uncompress the pdf document:
qpdf --qdf --object-streams=disable source.pdf uncompressed.pdf
Then remove the text (footer) with the following sed:
sed -e "s/string to be removed/ /g" <
uncompressed
.pdf >removed.pdf
And lastly repair the pdf and compress it again.
pdftk
removed
.pdf output target.pdf compress
remember to clean up and remove all the interim files.
Sadly, PDF can't be edited. After opening a PDF, the consumer can solely learn it and do nothing aside from that. That's the reason these information are of smaller measurement. If you want to learn more about this topic please visit here
ReplyDelete