Free Support Forum -

Replace text in PDF not working

I tried the replace pdf text using Aspose.Pdf, as described in the example here:

The target file was a Version 1.5 PDF produced by Adobe Print to PDF.

The text in question was found and replaced, but so was some surrounding text, and there were artifacts created as well.

Can someone tell me why this is happening and how to fix it?

Hi there,

Thanks for your inquiry. Could you please share your sample input and output document here? So we will test it at our end and provide you more information.

Sorry for the inconvenience faced.

Best Regards,

Ok, sure.

Here are some example files that show the before and after.

My code is the same as in the Replace Text example, except that I am only replacing text. I have commented out the code for changing font, font size, and font colors.

Thanks for your response.

Hi there

Thanks for providing source document. It seems you are evaluating Aspose.Pdf without a license, as I'm unable to observe reported issue. Aspose.Pdf evaluation version has two limitations, evaluation watermark and at most four elements of any collection can be viewed. Please make a request for 30 days temporary license to evaluate our product without any limitation, Hopefully your issue will be resolved.

Please feel free to contact us for any further assistance.

Best Regards,