Skip to main content
sebastianb99835257
Inspiring
December 14, 2017
Answered

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

  • December 14, 2017
  • 2 replies
  • 5814 views

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.

This topic has been closed for replies.
Correct answer Thom Parker

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

2 replies

Participant
November 9, 2020

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

Participant
November 9, 2020

@Thom Parker Any help?

Thom Parker
Community Expert
Community Expert
December 14, 2017

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 PDFScriptingUse the Acrobat JavaScript Reference early and often
sebastianb99835257
Inspiring
December 18, 2017

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.

sebastianb99835257
Inspiring
February 9, 2018

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.


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?