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

Free Support Forum - aspose.com

Indexing and searching within PDF document

Hi support team,

I have the requirements of indexing and searching content within a PDF document for my application, please guide on how to achieve it using Aspose.Pdf:

Let’s say, I have a PDF document of 100 pages. I want to index the pages of the document and save the information about the pages and the content of the pages in the database. I want to implement the feature where user will enter some word or the sentence and I can search the whole document and return the page numbers along with the whole page where the content was found.

Also please guide do I need the database or aspose.pdf can allow to index and search without saving information in the database?



Thank you for contacting support.

We would like to share with you that you can search text from any PDF document as explained in Search and Get Text from Pages of a PDF Document. Then you can get page number of found text by using textFragment.Page.Number property and can return the page as under:

Page page = textFragment.Page;
return page;

Please also visit Working with Pages for your kind reference. We hope this will be helpful. Please feel free to contact us if you need any further assistance.