Text Find and Replace

This code example demonstrates how to replace specific text on any PDF document. This feature can be applied to both newly rendered and existing PDFs.

To replace text in a PDF document, you can utilize the replaceText method. It requires three arguments: the old text to find, the new text to replace it with, and the page index where this replacement should take place. In this example, it substitutes ".NET6" with ".NET7" on the specified page.

Once the text replacement is completed, you can save the modified PDF document using the saveAs method.