Solved

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

Posted on 2004-10-20
9
391 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dropbox file only prints first page 9 77
Notification massage in SharePoint 2010 5 58
PDF Weirdness 15 50
Acrobat plug in could not be verfied in firefox (Mac) 6 91
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
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 sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now