Hi Guys, In this post I will explore the implementation details for searching the contents inside the pdf's,
Writing this post based on a real-time requirement in my project, the requirement was to provide a UI where the user can enter the text to search, and display the results i.e. pdf's in a grid view that contains the search keyword with the option to download the pdf files.
Initial plan
was to search by reading the pdf's from physical file system one by one, but since No of pdfs were large we decided to store the pdf files in the database.
Below Third-party libraries options
were initially explored for searching pdf 's stored in File system –
Sl No
|
Library
|
Type
|
Remarks
|
1
|
iText
|
Paid
|
|
2
|
BitMiracle
|
Paid
|
|
3
|
FreeSpire.PDF
|
Free
|
Page limit
per pdf is limited to 10 Pages in the Free version
|
4
|
Spire.PDF
|
Paid
|
|
To Search
pdf files a software called as PDF iFilter is provided by Adobe so that we can search for pdf files that was stored and indexed in Sql Server.
Adobe PDFiFilter provides the ability for SQL Server to read the pdf contents.
Adobe PDFiFilter uses the Microsoft iFilter interface and
allows third-party indexing tools to extract text from Adobe PDF files.
Below steps will all the configurations steps for configuring the Adobe PDF iFilter -
Step 1) Full Text Search Installation check -
To check whether Full Text Search is installed or not, query the IsFullTextInstalled parameter.
select serverproperty('IsFullTextInstalled')
It should return 1
If it returns 0, the feature needs to be
installed from SQL Server installation. install the Full Text Search in the feature selection page of Sql server installation