hi im using the app.execMenuItem("Annots:Tool:InkMenuItem"); in the javascript of textbox in acrobat pro 9. When i click the text box pen tool is activated and im able to sign in that textbox.
But in acrobat reader 10.1.2 when i click the textbox its not working . i.e (app.execMenuItem("Annots:Tool:InkMenuItem"); ) is not executing . Is there any other command to get pen tool in acroabat reader x.
Couple of issues there:
1. Your code should not work at Acrobat Pro 9 at all, unless you've edited the registry and added this menu item to the white-list, or you're actually calling it from a trusted function in a folder-level script.
2. The menu items in Acrobat and Reader X have changed dramatically. You need to make sure that this item is still available through the menus, and that its name has not changed.
3. If commenting for the file in Reader is not enabled, its possible that this menu item could not be executed at all there.
sorry,
what i want to say i . For the textbox in actions
For select Action : i selected Execute a menu item.
Then added a javascript . In java script i added the code app.execMenuItem("Annots:Tool:InkMenuItem"); in it.
Its working fine in acrobat pro 9 and even reader.
But giving issue in 10.1.2 . Is there any other command in place of this .
Actaully this code is printing a flower using ink tool. can to modify this code so that instead of printing it should display inktool by using which i draw my own sign or image etc.
var inch =72, x0 =2* inch, y0=4*inch;
var scaledInch=.5*inch;
var nNodes=60;
var theta=2*Math.PI/nNodes;
var points =new Array();
for(var i=0;i<=nNodes;i++)
{
Theta =i*theta;
points[i]=[x0+2*Math.cos(3*Theta)*Math.cos(Theta)*scaledInch,
y0+2*Math.cos(3*Theta)*Math.sin(Theta)*scaledInch];
}
var annto= this.addAnnot(
{
page:4,
type:"Ink",
name:"onMarketshare",
author:"A.c. Robat",
gestures:[points],
strokeColor:color.red,
width:5,
contents:"This section needs revision"
}
);
thanks,
sachin
Actaully this code is printing a flower using ink tool. can to modify this
code so that instead of printing it should display inktool by using which i
draw my own sign or image etc.
var inch =72, x0 =2* inch, y0=4*inch;
var scaledInch=.5*inch;
var nNodes=60;
var theta=2*Math.PI/nNodes;
var points =new Array();
for(var i=0;i<=nNodes;i++)
{
Theta =i*theta;
points[i]=[x0+2Math.cos(3Theta)Math.cos(Theta)scaledInch,
y0+2Math.cos(3Theta)Math.sin(Theta)scaledInch];
}
var annto= this.addAnnot(
);
thanks,
sachin
Yes, there is. And your code is correct. If you run that code from the console window you will see that it works. The problem is that menu item cannot be generally run from a non-privileged context. They have to be on a white list. In windows this is a registry setting:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Adobe Acrobat\8.0\FeatureLockDown\cDefaultExecMenuItems
On the Mac it's in a setting file.
Thom Parker
The source for PDF Scripting Info
pdfscripting.com
The Acrobat JavaScript Reference, Use it Early and Often
Then most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)
Sorry it took me a while to get back to this thread, been busy.
For obvious security reasons a PDF script cannot modify the registry. Acrobat JavaScript is very well protected. However, you can save the registry settings out of the registry editor to a ".reg" file. When the user clicks on this file, Window's knows to import the settings. In the registry editor, look on the File menu for the "Export" entry.
Ideally you could make this *.reg file an attachment to a PDF and then use a script to launch it, but I don't think this will work. There are a number of file extensions that Acrobat will not export. I wouldn't be suprised if *.reg was one of them. So you may have to pass this file around in a zip, or create a windows installer file.
North America
Europe, Middle East and Africa
Asia Pacific