We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Strange Behaviour in PDFContentEditor.replaceText

Hi Aspose Team,

i use PDFContentEditor.replaceText to replace some Text in a PDF File. The replacement is done well, but surprisingly the function replaces more than it should.

All ‘y’ are replaced by ‘n’.
All ‘s’ are replaced by 'g’
All ‘r’ are replaced by 'e’

And some more.

I used contentEditor.replaceText(“Münster”, “Leipzig”);

Regards, Golo

Hi Kay,

Please share the problematic PDF file(s) along with the code snippet with us, so we could test the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

Hi,

here is the code snippet

PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.bindPdf(new FileInputStream(“d:/report.pdf”));
contentEditor.replaceText(“Münster”, “Leipzig”);
contentEditor.save(“d:/Test/testasposerpl.pdf”);

Regards, Golo


Hi Golo,

I have tested this issue at my end and noticed that on the two places the text is replaced without any spelling mistake but with different font size and font weight; however, on third location only an ‘s’ is being replaced with ‘g’. Please have a look at the attached output file and see if this the same problem you’re facing at your end. Also, please download the latest version and try with that, so we could be on the same page.

We’re sorry for the inconvenience and appreciate your cooperation.
Regards,

Hi,

when i open the PDF File you generated i can clearly see the same errors. i attached a picture of that. This seems to be some encoding problems to me. Even your apose licence text is spelled wrong.

Golo

Hi Kay,

I have logged this issue as PDFKITJAVA-18753
in our issue tracking system. Our team will investigate this issue in detail and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 18753) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.