Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: MenuItemExecute and OCR

318 views
Skip to first unread message

Dan_M...@adobeforums.com

unread,
Jul 8, 2008, 2:32:33 PM7/8/08
to
Did you happen to figured out how to automate the OCR process?

MenuItemExecute("Cpt:CapturePages") only opens the dialog box that controls OCR. It doesn't automatically OCR the document.

Is there a way to programatically tell the dialog box that the CapturePages method opens to execute?

Bernd Alheit

unread,
Jul 8, 2008, 4:05:04 PM7/8/08
to
Acrobat Capture has a programming interface.

P...@adobeforums.com

unread,
Jul 8, 2008, 5:47:43 PM7/8/08
to
SendKeys is by no means a production environment solution. It may work for your solution, which is great, but it is not something that really should be recommended for any sort of large-scale deployed workflow. The user at the keyboard hitting anything at all at the wrong time, or clicking out of the dialog so focus is lost at the wrong time, would cause it to fail and could cause entirely unpredictable results. Certainly not something that should ever be recommended as a real solution.

Capture is an Adobe product for advanced OCR workflows and comes with an automation SDK similar to Acrobats.

P...@adobeforums.com

unread,
Jul 8, 2008, 3:04:05 PM7/8/08
to

Did you happen to figured out how to automate the OCR process?


You can't. There are no APIs for this.

Is there a way to programatically tell the dialog box that the CapturePages
method opens to execute?


No. OCR is not exposed to automation.

Dan_M...@adobeforums.com

unread,
Jul 8, 2008, 5:30:07 PM7/8/08
to
Figured it out:
Following code worked perfectly for me for OCRing the first two pages of the PDF (for my purposes I only want the first two pages).

Send keytstroke combinations to acrobat to manipulate OCR Dialog Box. Finish by sending TAB keystrokes to move to OK button and sending ENTER keystroke to start OCR Text Recognition.

Dim Acroapp As CAcroApp
Set Acroapp = CreateObject("AcroExch.App")
Acroapp.Show
Dim AVDOC As CAcroAVDoc
Set AVDOC = CreateObject("AcroExch.AVDoc")
dd = AVDOC.Open(Path, TempName)
Dim PDDoc As CAcroPDDoc
Set PDDoc = CreateObject("AcroExch.PDDoc")
Set PDDoc = AVDOC.GetPDDoc
'''''' SEND KEYSTROKES TO ACROBAT TO MANIPULATE OCR DIALOG BOX
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("{DOWN}")
SendKeys ("2")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{ENTER}")
Acroapp.MenuItemExecute ("Cpt:CapturePages")

Let me know what you guys think...

Also, can you elaborate on the "Acrobat Capture programming interface" Bernd?

vinoth...@gmail.com

unread,
Aug 10, 2012, 3:55:45 AM8/10/12
to
Hi,
how to send the keystroks to acrobat.. is there any code for that..
0 new messages