Bookmark pages after finding specific content in the PDF

Hi,

Is there anyway find the specific string from the PDF and mark it for constructing the bookmark

Thanks

Hi Diane,


Thanks for contacting support.

Aspose.Pdf for Java provides the feature to create as well as manipulate existing PDF files. It also offers the feature to search particular text string inside the PDF and also provides the capabilities to create bookmarks in PDF file.

So as per your requirement, first you need to search particular text inside PDF, get associated page number and then create a bookmark pointing to certain page. For further details, please visit


PS, in order to get the page number over which TextFragment exists, please try using System.out.println(textFragment.getPage().getNumber());