Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-10-20
9
Medium Priority
?
403 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
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

715 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