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

Free Support Forum - aspose.com

Opening an exisiting PDF file- and replacing a text value on all pages

Hi,

This is what we are trying to do. Say we have an existing 500 page PDF document, and it has a particular text value on each page that we need to replace, how do i go about doing that.

Is there a way to read in the existing 500 page document page by page(so as to keep the memory requirements down - as opposed to reading the entire doc at once) and do the text replacement for each page before saving the document back with the replacement applied?

Looking forward to some help on this.

thanks,

Jaideep.

Hi Jaideep,

Aspose.Pdf.Kit allows you to replace text on all the pages or on a particular page; however, while replacing the text on a particular page, you still need to load the full PDF file into memory; I’m afraid, you can’t load the pages one by one into memory. Please try the above specified methods at your end and see if it helps.

If you find any further questions or concerns, please do let us know.
Regards,

Hi,

Thanks for the reply.

This method wont be scalable. If someone has a really large PDF file, that would create memory issues and possibly break the application.

Is there any possible workarounds that you guys can suggest? There should be a way to read one page at a time (like a PDF reader) and replace text on that page and so on.

Looking forward to suggestions.

thanks,

Jaideep.

Hi Jaideep,

I’m sorry to inform you that currently it is not feasible to load the PDF file into memory page by page; however, I have logged a new feature request as PDFKITNET-21163 in our issue tracking system. Our team will look into this issue and try to provide support, if feasible, in our future versions.

We’re sorry for the inconvenience.
Regards,