Search a text enabled PDF using Visual Foxpro

Is there a way to programatically search a text enabled pdf (or group of PDF's) from within Visual Foxpro?
Who is Participating?
Olaf DoschkeConnect With a Mentor Software DeveloperCommented:
No and yes. You need some third party tool to extract the text out of the pdf or search within a pdf, this is not natively built into VFP (but then where is it?).

Windows Search supports searching within PDFs, when a PDF IFilter, such as the Adobe Acrobat Reader or Foxit PDF IFilter, is installed. then you can find PDF files via Windows Search, which you can utilize programmatically from VFP.

Needing Vista or higher:
loConn.ConnectionString="Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"

Text To lcWSSQL NoShow
SELECT System.ItemFolderPathDisplay, System.Filename 
FROM SystemIndex 
WHERE CONTAINS('searchstring') AND System.FileExtension = '.pdf' 

loRs = loConn.Execute(lcWSSQL)
Do While Not loRS.EOF
   loPath = loRs.Fields.Item("System.ItemFolderPathDisplay")
   loFile = loRs.Fields.Item("System.Filename")

   lcFilename =  Addbs(loPath.Value)+loFile.Value
   ? lcFilename

Open in new window

More about Windows Search SQL Syntax at

Bye, Olaf.

Bye, Olaf.
HCPCJJ1Author Commented:
This is perfect.  Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.