These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Run a batch sequence from command-line

quicotte
Registered: Apr 27 2009
Posts: 2

Hi all,

Does somebody knows if it is possible to run an Acrobat batch from the command line ( DOS I mean ).

I am running Acrobat 9 Pro.

Best regards.
Q.

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Never heard of such an option.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
No, this is specifically something that Acrobat keeps from happening. Batch processes have to be initiated manually.

But there is somethig you can do to make a Batch Like process. Write a VB program to control Acrobat through the IAC (Interapplication Communication Interface) You'll find the documentation at www.adobe.com/devnet/acrobat


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

davidp
Registered: Feb 23 2010
Posts: 3
Hi, can you give any specific examples of VB6 code to do this.

My project is as follows.

We need to scan around 40 documents a day using our office copier that has an ADF and scans to the server in pdf format.

I then want to have an application that will interface with acrobat and OCR each document and save the text into a text file. I will then process teh text in my VB6 app to index the document into the database.

I can do the above manually via an acrobat batch sequence but I need to automate it so that their is minimal input from the user (also to that it could run as an automated server processes if required).

I am new to developing with acrobat but have a lot of experience with VB6 (do not know vb.net unformatunately)

Many thanks
Dave
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is a perfect application for a VB automation program. You can find examples in the Acrobat SDK and the Interapplication Communication (IAC) interface reference.

http://www.adobe.com/devnet/acrobat/?view=overview

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

davidp
Registered: Feb 23 2010
Posts: 3
Should I use OLE or DDE ?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Use OLE, It has much more functionality, including the ability to access the JavaScript model in Acrobat. DDE is acient technology from the DOS days.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

davidp
Registered: Feb 23 2010
Posts: 3
Sorry to be a pain but I am struggling to find an appropriate example to run the OCR command and output the text into a text file.

I assume I need to use “menuitemexecute” but I cant find the relevant argument for the correct menu items.

If running manually you would use:

Document->OCR Text Recognition->Recognize Text Using OCR.
File->Save as (then select text accesable as the file type)Or to run a batch process from VB
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Read this article, be sure to read the restrictions part:
http://www.acrobatusers.com/tutorials/2008/06/executing_menu_items_from_javascript

And you'll find a toolbar button for display the "Read" menu item names here:
http://www.pdfscripting.com/public/65.cfm

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
As you'll discover, you can't automate an OCR followed by a Save as Text from JavaScript, But you can do this from a Batch process. You can't start a batch sequence from VB or from JavaScript.

However, you could write a plug-in that does this, and can be initialed from either JavaScript or VB.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

mczajka
Registered: Oct 11 2005
Posts: 29
These guys are very good.

http://www.evermap.com/autobatch.asp
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Acrobat doesn't do watch folders. You'll need to write your own program for this or purchase a 3rd party product.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script