Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Customizing the Acrobat Toolbar

0 views
Skip to first unread message

Gw...@adobeforums.com

unread,
Dec 18, 2003, 2:06:31 PM12/18/03
to
I want to customize the Acrobat Toolbar by adding a button that will run an executable (call it "myprog.exe"). Is there any way of accomplishing this? I'd also like to do this in Adobe Reader, as well.

Thanks.
Gwyl

Ian_M...@adobeforums.com

unread,
Dec 19, 2003, 3:56:11 AM12/19/03
to
hmm

you can add menu items via javascript using the app.addMenuItem method, but it does not seem that you can add toolbar buttons

If you want to add a menu item try the following;

create a text file in your My Documents\Adobe\Acrobat\Javascripts folder, callit what you like, but make sure the file extension is changed to '.js' (e.g. myscript.js)

Edit this file in notepad, and add the following code;

function merge() {

var evenFile = app.response({ cQuestion: "Please enter the \"Even File\" (e.g. C:\\My Documents\\Even.pdf). ", cTitle:
"Even File"});
var oddPages = this.numPages

try {
for (i=0; i<oddPages; i++) {
this.insertPages((i*2),evenFile,i);
}
}
catch(e) {
app.alert(e);
}
}

function reversemerge() {

var evenFile = app.response({ cQuestion: "Please enter the \"Even File\" (e.g. C:\\My Documents\\Even.pdf). ", cTitle:
"Even File"});
var oddPages = this.numPages

try {
for (i=0; i<oddPages; i++) {
this.insertPages((i*2),evenFile,(oddPages-i-1));
}
}
catch(e) {
app.alert(e);
}
}

app.addSubMenu({ cName: "Merge", cParent: "Document", nPos: 0});
app.addMenuItem({ cName: "Merge odd and even pages...", cParent: "HTT extras",
cExec: "merge();"});
app.addMenuItem({ cName: "Reverse merge odd and even pages...", cParent: "HTT extras",
cExec: "reversemerge();"});

Save the file, and restart Acrobat

This will add a new menu below the 'Document' menu called 'Merge' In this menu are two options for merging the odd and even scans of a double sided document. You should be able to modify my code to do what you want.

P.S. this is all for Acrobat 5, not tested yet in 6.0

Gw...@adobeforums.com

unread,
Dec 19, 2003, 9:59:37 AM12/19/03
to
Ian --
That's just what I was looking for. Thanks for taking the time to assist.

Gwyl

0 new messages