Solved

Creating a button on the Acrobat Application that will process menu item

Posted on 2004-10-20
9
393 Views
Last Modified: 2012-08-13
using vb.net and SDK how can I create a button that will process a menu item? I know you can do it using JSObject but I don't know how.
0
Comment
Question by:HeitmanProgrammers
  • 5
  • 4
9 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12358760
You would do something like this:

        Dim App As Acrobat.CAcroApp
        Dim PDDoc As Acrobat.CAcroPDDoc
        Dim AVDoc As Acrobat.CAcroAVDoc
        Dim jso As Object

        Dim coord(3) As Integer
        Dim button

        App = CreateObject("AcroExch.App")
        AVDoc = CreateObject("AcroExch.AVDoc")

        AVDoc = App.GetActiveDoc
        PDDoc = AVDoc.GetPDDoc

        jso = PDDoc.GetJSObject

        coord(0) = 100
        coord(1) = 100
        coord(2) = 172
        coord(3) = 136

        button = jso.AddField("NewField", "button", 0, coord)
        button.setAction("MouseUp", "app.execMenuItem('SaveAs')")


0
 
LVL 1

Author Comment

by:HeitmanProgrammers
ID: 12358844
what do you dim Button as also I want to run the Batch Process which is under Advanced > Batch Processing and once the Batch Processing menu comes up, I want to execute the Run Sequence button. I tried doing this with SendKeys in Vb .net but I can't get the focus on Run Sequence button.
0
 
LVL 1

Author Comment

by:HeitmanProgrammers
ID: 12358936
I tried your code however I am getting nullReference error
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12361463
Sorry, this was a cut&paste error. It's supposed to be
Dim button As Object

This JavaScript command will open the "Batch" dialog:

app.execMenuItem("BatchEdit");

0
 
LVL 1

Author Comment

by:HeitmanProgrammers
ID: 12361611
all right i can get to that, but how can programmatically click on the "Run Sequence" button?
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12364090
This is not possible with JavaScript. Adobe did not expose the batch sequences to JavaScript (probably to prevent you from automating Acrobat and use it in a way not licensed by the EULA).
0
 
LVL 1

Author Comment

by:HeitmanProgrammers
ID: 12370177
so what is my option to be able to click on the "Run Sequence" button?
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 12370738
If you cannot do it with the "SendKeys" command, there are no options.

I know of two applications that give you some automation of batch sequences, but unfortunately none of them is cheap:

http://www.pdfstore.com/details.asp?ProdID=654
http://www.caslonsoft.com/composite-56.htm

0
 
LVL 1

Author Comment

by:HeitmanProgrammers
ID: 12383701
all right, I am just running out of options on this.. thanx for your help Khkremer.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question