Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

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.
0
HeitmanProgrammers
Asked:
HeitmanProgrammers
  • 5
  • 4
1 Solution
 
Karl Heinz KremerCommented:
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
 
HeitmanProgrammersAuthor Commented:
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
 
HeitmanProgrammersAuthor Commented:
I tried your code however I am getting nullReference error
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
Karl Heinz KremerCommented:
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
 
HeitmanProgrammersAuthor Commented:
all right i can get to that, but how can programmatically click on the "Run Sequence" button?
0
 
Karl Heinz KremerCommented:
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
 
HeitmanProgrammersAuthor Commented:
so what is my option to be able to click on the "Run Sequence" button?
0
 
Karl Heinz KremerCommented:
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
 
HeitmanProgrammersAuthor Commented:
all right, I am just running out of options on this.. thanx for your help Khkremer.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now