Solved

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

Posted on 2004-10-20
9
396 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

734 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