Copy link to clipboard
Copied
Hi All,
I'm looking at creating a Javascript button that when clicked brings up the red pen so users can sign their names in a box.
I have been reading this and Thom Parker has provided an answer but I am still slightly confused.
Re: To draw in the pdf using pen tool in acrobat reader x
If I was to escalate this to my service desk what exactly would I tell them to do with a step by step process?
And once its enabled I'm assuming the following line of code will automatically bring up the pen tool ready for use?
app.execMenuItem("Annots:Tool:InkMenuItem");
Also assuming this will work in both running Adobe DC Reader and DC Pro?
Cheers,
Seb.
You are the right track. Each menu item is separated by a pipe symbol "|". Just add the menu item you want in there, and it's white listed for your machine. The "&" symbols mark the shortcut key for the item.
Close|GeneralInfo|Quit|Annots:Tool:InkMenuItem|FirstPage|PrevPage|NextPage|LastPage
Copy link to clipboard
Copied
After the pen menu item is white listed, it will be available in Acrobat. And executing the menu item with JS is the same as clicking on the menu item with the mouse.
Reader has it's own white list, but they are on parallel paths, and it will work in Reader because Reader allow annotations.
I would suggest you just look in the registry at this path and try it. You will see how it's done.
Copy link to clipboard
Copied
Hi Tom,
I have found cDefaultExecMenuItems in the Registry Editor > Double clicked > right clicked tWhiteList > this brings up a box which has Value data.
The value data looks like this:
Close|GeneralInfo|Quit|FirstPage|PrevPage|NextPage|LastPage|.......etc.......&Annotations|D&rawing Markups|Revie&w
My understanding is that I would edit this value data by adding the ink tool?
If so what exactly would I type?
LastPage|.......etc.......&Annotations|D&rawing Markups|Revie&w|????????
Am I on the right track?
Cheers,
Seb.
Copy link to clipboard
Copied
You are the right track. Each menu item is separated by a pipe symbol "|". Just add the menu item you want in there, and it's white listed for your machine. The "&" symbols mark the shortcut key for the item.
Close|GeneralInfo|Quit|Annots:Tool:InkMenuItem|FirstPage|PrevPage|NextPage|LastPage
Copy link to clipboard
Copied
Thanks for your help Tom!
I have escalated it to my service desk to change on my computer and I'll let you know how I go.
Cheers,
Seb.
Copy link to clipboard
Copied
Hi Thom,
I have successfully integrated this into a javascript button that zooms the page and frames the signature area and automatically brings up the pen for signing.
My questions is: Is there a way to change the pen colour from red to black?
This was some feedback I have just had from my stakeholders (red is apparently a negative colour).
There was this answer I found that involved manually changing the settings but was more after a JavaScript solution that I could incorporate into my existing button (How do I change the ink color for pen tool? )
edit: the version in question will be Adobe Acrobat Reader DC 2017
Cheers,
Seb.
Copy link to clipboard
Copied
The color of any annotation "line" is set with the "annot.strokeColor" property. Unfortunately I don't know the menu item name for the "Make Current properties default" menu item. So you'd have to set this for each annotation as they are created.
Copy link to clipboard
Copied
Thanks Thom,
I have had a bit of a search round into how to incorporate "annot.strokeColor" into my JavaScript and make the text black but with no luck.
Are you able to provide some guidance.. so far I am using the following which just brings up the red pen:
app.execMenuItem("Annots:Tool:InkMenuItem");
Cheers,
Seb.
Copy link to clipboard
Copied
Doing it with JS is possible, but extremely complicated. I can tell you from experience because I did it in this tool I've developed: Custom-made Adobe Scripts: Acrobat/Reader -- Quickly Switch Between Highlighter Colors
I would recommend instructing them to simply change the default settings once instead of trying to do it using a script.
Copy link to clipboard
Copied
I have tried the following code but it doesn't change the pen tool to black...
app.execMenuItem("Annots:Tool:InkMenuItem");
annot.strokeColor= ["G", 0];
Am I on the right track or completely missing the mark?
Copy link to clipboard
Copied
You're way off.
Copy link to clipboard
Copied
to do this a script has to find the annotation after it has been created. I've done this before by using a timer to poll the set of existing annots for a new Ink markup, then setting it's properties.
Copy link to clipboard
Copied
Do you have any code (or a starting point) that I can put on a button to select all annotations (or go through one at a time) and change the ink to black? Thanks
Copy link to clipboard
Copied
That's much easier. You can use this code for that:
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null) {
for (var i in annots) {
var annot = annots;
if (annot.type=="Ink") annot.strokeColor = color.black;
}
}
Copy link to clipboard
Copied
Thanks mate that's awesome!
Copy link to clipboard
Copied
How can I disable signatures in Adobe.
I have a form when I want every time user open the form he have to sign it (with draw function) and not use electronic sign which is saved.
That is why I want to disable signatures from it. Is there any way to do it?
Thanks
Copy link to clipboard
Copied
Prachi, your question doesn't seem to connect to the earlier discussion. Please can you explain the connection to whitelisting the InkMenuItem tool?
Copy link to clipboard
Copied
Am I too late to ask something in here??
... Anyways, how can you white list a tool or add a registry? Can someone please explain it step by step.
Thank you,
Leia
Copy link to clipboard
Copied
@Thom Parker Any help?
Copy link to clipboard
Copied
First Do a google search on "windows registry". You'll find plently of articles that explain how to use the registry editor.
Next find the registry entry for the menu item whitelist, which is under this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Adobe Acrobat\<version>\FeatureLockDown
You'll also find lots of Adobe registry settings here:
https://www.adobe.com/devnet-docs/acrobatetk/tools/PrefRef/Windows/endindex.html
Also lots of good stuff here:
Copy link to clipboard
Copied
Hi,
I need to do the same @sebastianb99835257 asked but in android.
Do you know how to do it? Or, do you know what the equivalent of "registry editor" is but instead of Windows, Android?
I followed the steps @Thom Parker said in Windows and it works but just on my computer, now I need to do the same in Android, please, help me.
I need to configure a hundred tablets.
Thank you in advance
Copy link to clipboard
Copied
Android is completely different, it's based on Unix. I don't know if there is anything remotely similar to the windows registry, or if it is used by the Mobile Acrobat. I'd suggest getting a file system explorer for Android and looking arround the Acrobat area for setup files. You might discover something.
Copy link to clipboard
Copied
Is there even such a menu item on Android? Are there menus at all?
Copy link to clipboard
Copied
No. This is a non-starter.
Copy link to clipboard
Copied
execMenuItem is not available in Acrobat Reader for Android or iOS.