Link to home
Start Free TrialLog in
Avatar of HeitmanProgrammers
HeitmanProgrammers

asked on

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

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.
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

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')")


Avatar of HeitmanProgrammers
HeitmanProgrammers

ASKER

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.
I tried your code however I am getting nullReference error
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");

all right i can get to that, but how can programmatically click on the "Run Sequence" button?
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).
so what is my option to be able to click on the "Run Sequence" button?
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
all right, I am just running out of options on this.. thanx for your help Khkremer.