Search inside a pdf document for a specific text without opening the document?
How can I search inside a pdf document for a specific text without opening the document, and if it finds the text in the pdf document a MsgBox should pop up. I really need help with this.
Without useing Adobe Acrobat SDK or some sort of plugin, I'm afraid its extremely hard.
Near impossible if the PDF is useing subset fonts.
Impossible if the fonts have been converted to outlines.
IMHO,
-Lou
Unless you're looking for Document Structuring elements, which are normally text strings. Then its pretty simple. Of course, I don't think you meant you were looking for things such as startxref.
Nope. I'd have to develop it, since I have'nt used SDK for about 3 years.
If you have the Adobe Acrobat Application, {Not the reader, but the full app}, then I'd suggest downloading the Adobe Acrobat SDK 5 development kit from Adobes site {5.0 is still publicly available, but 6.0 isn't. you'd have to spend 1000 bucks to become registered as a developer before you could get 6.0}.
Once you get the 5.0 SDK, with the manuals, you'll find documentation for developing in VB. They have methods for extracting text, and even methods for saveing PDF's as text via VB.
for example:
VB Code:
GetText: BSTR GetText(long nTextIndex);
Description
Gets the text from the specified element of a text selection.
To obtain all text in a text selection, use PDTextSelect.GetNumText
to determine the number of elements in the text selection,
then use this method in a loop to obtain each of the elements.
Parameters
nTextIndex The element of the text selection to get.
Return Value
The text, or an empty string if nTextIndex is greater than the
I have tried but without any success. I have also tried the sample app you upload here, without any success. Can show me a simple form with a working code wich does this?
I would be very greateful if you could do this.
searchpdf won't work if you haven't installed the SDK on your system.
It also {I think} won't work if you don't have the complete Adobe Acrobat app. And I think it has to be 3.0 or higher.
So, try getting Acrobat SDK 5.0 from Adobes site {Find the Downloads area, ummm, just looking at their site. Not so good. Perhaps I'll refresh...
lol!!!
I have Acrobat SDK 5.0 installed at my computer already. But it still not working. Can't you show me a simple working form with two textboxes and one commandbutton, where I put the searchword in the first textbox and the path (C:\pdfFile.pdf) to the pdf file in the second textbox. I search with the commandbutton. If it finds the searchword a MsgBox should pop up.
Even though I have SDK 5.0 installed on my computer and Reference to Adobe Acrobat 5 Type Library is activated, I get a error:
"ActiveX component can't create object"
It stops on the row:
Set gApp = CreateObject("AcroExch.App")
Why?
Last edited by Pirre001; Oct 11th, 2003 at 04:40 PM.