PDF Text Replacer Command Line can’t remove text contents permanently, it does hide text instead of remove it completely

Hi,

I have to say that I am impressed by your support! Every answer is a great help and it works.

So, now point 1 & 3 are solved. It looks perfect and almost like the original PDF file. The output is also significantly smaller.

image

Regarding the multiple replacements I have this issue:
Running this command does not replace the 1st expression:

.\pdftr.exe -wordbywordfrompdf 1 -replacesubstrings 1 -searchandoverlaytext "M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=> ||2620247=>****" -overlaybgcolor F1F1F1 -overlaytextcolor 000000 -overlaytextfontsize 70% input.pdf output.pdf

Even this does not replace the expression [only 1 replacement is specified]:
.\pdftr.exe -wordbywordfrompdf 1 -replacesubstrings 1 -searchandoverlaytext "M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=> " -overlaybgcolor F1F1F1 -overlaytextcolor 000000 -overlaytextfontsize 70% input.pdf output.pdf

This is the output:
[Message] Trial version has some restrictions, please purchase full version to remove the restrictions.
[Message] You have 78 times to evaluate this software, you may purchase a full version from "https://www.verypdf.com" web site.
[Message] Try to replace text by overlay mode...
[ReplaceText] M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=>
[ContentParserExport] Processing page 1 of 2...
[Found and Overlay] [INFO] We will find 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic' and overlay with ' '...
[Found and Overlay] [INFO] Nothing was found for 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic'...
[ContentParserExport] Processing page 2 of 2...
[Found and Overlay] [INFO] We will find 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic' and overlay with ' '...
[Found and Overlay] [INFO] Nothing was found for 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic'...
[Message] Create "D:\Output.pdf" file successful.

BUT, this replaces the expression:

.\pdftr.exe -contentreplace "M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=>" input.pdf output.pdf

This is the output for the working replacement:
[Message] Trial version has some restrictions, please purchase full version to remove the restrictions.
[Message] You have 77 times to evaluate this software, you may purchase a full version from "https://www.verypdf.com" web site.
[Message] Try to replace text in page contents...
[ReplaceText] M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=>
[ContentParserExport] Processing page 1 of 2...
[Message] Output to "C:\Users\admin\AppData\Local\Temp\vpdf-13240-1517004617-25794-3.txt" file.
[Not Found in] 'VeryPDF Software Demo Version (https://www.verypdf.com)'
[Not Found in] 'VeryPDF Software Demo Version (https://www.verypdf.com)'
[Message] Open "C:\Users\admin\AppData\Local\Temp\vpdf-13240-1517004617-25794-3.txt" file.
[ContentParserExport] Processing page 2 of 2...
[Message] Output to "C:\Users\admin\AppData\Local\Temp\vpdf-13240-1517004617-10340-4.txt" file.
[Not Found in] 'VeryPDF Software Demo Version (https://www.verypdf.com)'
[Not Found in] 'VeryPDF Software Demo Version (https://www.verypdf.com)'
[Message] Open "C:\Users\admin\AppData\Local\Temp\vpdf-13240-1517004617-10340-4.txt" file.
[Warning] Failed to search keywords in PDF pages, we will switch to 'overlay' mode to try again.
[Message] Try to replace text by overlay mode...
[ReplaceText] M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=>
[ContentParserExport] Processing page 1 of 2...
[Found and Overlay] [INFO] We will find 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic' and overlay with ' '...
[Found and Overlay] 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic'=>' '
[ContentParserExport] Processing page 2 of 2...
[Found and Overlay] [INFO] We will find 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic' and overlay with ' '...
[Found and Overlay] [INFO] Nothing was found for 'M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic'...
[Message] Create "D:\Output.pdf" file successful.

MY QUESTION:
Is there a way to replace the long expression together with the small expression together with the argument list or do I have really to run pdftr.exe second time with the different replacement argument?

You can use the previously uploaded original file for testing.

Attached the output file when running the long command including both replacements and your suggested arguments. Very good!

Customer
-------------------------------------------------
"M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic" is a sentence, but not a word, so if you use "-wordbywordfrompdf 1" parameter, pdftr.exe can't find "M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic" sentence.

However, you can run pdftr.exe two times, for example,

pdftr.exe -wordbywordfrompdf 1 -replacesubstrings 1 -searchandoverlaytext "2620247=>****" -overlaybgcolor F1F1F1 -overlaytextcolor 000000 -overlaytextfontsize 70% D:\downloads\input.pdf D:\downloads\Output.pdf

pdftr.exe -searchandoverlaytext "M.R Stefanika 86-7 Martin, Slovakia 03601 Slovak Republic=>" -overlaybgcolor F1F1F1 -overlaytextcolor 000000 -overlaytextfontsize 70% D:\downloads\Output.pdf D:\downloads\Output.pdf

I hope these two command lines will work better for you, please give them a try.

VeryPDF
-------------------------------------------------
Perfect! Thanks to your hint regarding the "sentence" I understood now the process.
This is my version for the replacement in ONE call and I can live with it because I reveal the information that the address will be removed from the pdf.

.\pdftr.exe -embedfont 0 -wordbywordfrompdf 1 -replacesubstrings 1 -searchandoverlaytext "M.R=>||Stefanika=>||86-7=> ||Martin,=> ||03601=> ||Slovak=>||Republic=>||Slovakia=>||26202470=>****" -overlaybgcolor F1F1F1 -overlaytextcolor 000000 -overlaytextfontsize 70% Input.pdf Output.pdf

PS: Your program is processing the expression from right to left so I had to put "Slovakia" at the end otherwise the "ia" remained from the 1st replacement.

THANK YOU VERY MUCH! This case is now closed for me!

Customer
-------------------------------------------------
Thanks for your message, yes, your solution is great, it's better than run two command lines, you given me a good idea, thank you.

VeryPDF
-------------------------------------------------
Hi,

I could successfully replace all texts I wanted to.

By accident I found out that the replaced text is STILL available in the pdf file.
Please check attached file:
1) I am using a PDF Editor Software.
2) When I search in the MODIFIED pdf file for some text which is BEFORE the replaced text the PDF Editor shows me the replaced text - I thought this text has been permanently removed.

Do you understand the problem that apparently the replaced [and very sensible] text can be still revealed?

See also my description text in the attached screenshot. The modified pdf file can be used from the previous ticket.

How can I remove the replaced text PERMANENTLY from the pdf file?

Kind regards,
Customer
-------------------------------------------------
Thanks for your message, yes, "-searchandoverlaytext" option does hide original text instead of remove it, because "remove a word" may damage original page layout, for example, if we remove a word from a sentence, the subsequent words may be moved forward also, this will cause some unexpected problems, so we have to hide the original text contents instead of remove them permanently, this will maintain original layout perfectly.

In general, "-contentreplace" option will remove text permanently, however, because your PDF file doesn't contain readable texts in the PDF contents, so this option is not work for your PDF file.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!