Hello, we are Search Text and Replace Text in PDF file currently. We use pdftr (184.108.40.206) toin a pdf and the resultant file is rather larger. Before is e.g. 332kb, after replacing e.g. 4 of 15 character word with 20 characters 751kb.
The command we use is:
%1 is file.pdf (also is %destfile%)
%2 is searchfor
%3 is replacewith
pdftr.exe -$ "VERYPDF-LicenseKey" -searchandoverlaytext "%~2=>%~3" -overlaytextfontname "Arial,Italic" -overlaytextfontsize 12 %1 %destfile%
Is there any way of reducing the resultant file size?
Thanks for your sample PDF files, we noticed the increased file size due to the embedded font data, you can use "-embedfont 0" option to disable font embedded function, the generated PDF file will small, you may run following command line to try,
pdftr.exe -$ "XXXXXXXXXXXXXX" -embedfont 0 -searchandoverlaytext "$$eeSign=>Authorised by Mr TEST Yrruc-TEST||$$eeSigd=>25/01/2023 15:43" -overlaytextfontname "Arial,Italic" -overlaytextfontsize 12 D:\Downloads\Agreement.pdf D:\Downloads\Signed_Agreement-1.pdf
Yes, -embedfont 0 has helped.
One last thing.. Is there any way to reduce the size once it has increased, i.e. on historic docs?
I tried running pdftr with -embedfont 0 and a "null" search / replace ("Authorised by=>Authorised by”) on one which originally was created without that parameter but with no major effect. FYI pdftr.exe is the only VeryPDF tool we have.
Thanks for your message. Yes, it is possible to reduce the PDF file size created by the "-embedfont 1" option (default option), but it is not easy. These PDF files contain additional embedded font data. To reduce the PDF file size, we would have to remove the embedded font data first and then modify the PDF contents to use system fonts instead of embedded fonts. This work can not be done easily.
However, if this function is important to you, we can develop another PDF Command Line Tool for you. This new tool will remove embedded fonts and use system fonts automatically. But, there will be an additional development cost for this work. If you are interested in this solution, please let us know, and we will provide a quote shortly.