• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to whitelist "app.execMenuItem("Annots:Tool:InkMenuItem");"

Explorer ,
Dec 13, 2017 Dec 13, 2017

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.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

3.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 19, 2017 Dec 19, 2017

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

Votes

Translate

Translate
Community Expert ,
Dec 14, 2017 Dec 14, 2017

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 18, 2017 Dec 18, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2017 Dec 19, 2017

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

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2017 Dec 20, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2018 Feb 08, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2018 Feb 08, 2018

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2018 Feb 08, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2018 Feb 08, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2018 Feb 08, 2018

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

You're way off.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2018 Feb 09, 2018

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2018 Feb 13, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 13, 2018 Feb 13, 2018

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;

    }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2018 Feb 13, 2018

Copy link to clipboard

Copied

Thanks mate that's awesome!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 16, 2019 Jan 16, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 16, 2019 Jan 16, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2020 Nov 09, 2020

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2020 Nov 09, 2020

Copy link to clipboard

Copied

@Thom Parker Any help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2020 Nov 09, 2020

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:

https://www.adobe.com/devnet-docs/acrobatetk/tools/Wizard/tools.html#removing-tools-from-the-tools-t...

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 04, 2022 Apr 04, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2022 Apr 04, 2022

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. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

Is there even such a menu item on Android? Are there menus at all?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

No. This is a non-starter.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

LATEST

execMenuItem is not available in Acrobat Reader for Android or iOS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines