Previous | Next | (P-PDF) Acrobat 6.0
Topic: Creating toolbar button in Adobe
Conf: (P-PDF) Acrobat 6.0, Msg: 89650
From: crid
Date: 6/12/2003 06:52 PM
This can be done using Acrobat JavaScript -- using the this.path property, and the lastIndexOf() and substring() methods in the JSObject. I've included the code that will do this below:
----------------------------------
//Directory to save file to
var dirPath = "/c/Temp/";
//Get full path to current file
fileString = this.path;
//Substring to look for
subString = "/";
//Get PDF filename only
var testString = fileString.substring(fileString.lastIndexOf("/")+1, fileString.length);
//Now save the file to the specified directory
this.saveAs(varPath + testString);
-----------------------------------
Now for the toolbar button -- you can do this using ARTS PDF Tools. This is a customisable toolbar for Adobe Acrobat, and what you can do is assign a JavaScript action to run when you click on a toolbar button (that you setup/create). I've created the tool for you here Yvan (see attached), you need to use the 'import tool' function in ARTS PDF Tools and you'll find it will appear on your Acrobat toolbar!
You can download a free evaluation of ARTS PDF Tools from here - www.aroundtablesolution.com/arts_pdf_tools.asp. You can still use the JavaScript code without using ARTS PDF Tools, but that means no cute little toolbar button.
I hope this helps...
- Chris.
___________________________________
Chris Dahl - CTO
ARTS PDF Solutions
chris.dahl@aroundtablesolution.com
http://www.aroundtablesolution.com/
ARTS - A Round Table Solution