Skip to main content
Participant
March 7, 2018
解決済み

Can I create a custom context menu for PDF Fields using Javascript?

  • March 7, 2018
  • 返信数 2.
  • 716 ビュー

Background : I want to create or add my custom action to context menu shown when you right click on a field in PDF.

Approach : Using Javascript is it possible to add my custom actions to this field context menu?

このトピックへの返信は締め切られました。
解決に役立った回答 Thom Parker

Use the app.popUpMenu() function.

Add a script like this to the MouseUp Event on a field. It triggers off of Ctrl/Cmd-Click

if(event.modifier)

{

   var cRtn = app.popUpMenu(...);

    switch(cRtn)

    {

        ... Process Results ...

     }

}

返信数 2

Thom Parker
Community Expert
Thom ParkerCommunity Expert解決!
Community Expert
March 7, 2018

Use the app.popUpMenu() function.

Add a script like this to the MouseUp Event on a field. It triggers off of Ctrl/Cmd-Click

if(event.modifier)

{

   var cRtn = app.popUpMenu(...);

    switch(cRtn)

    {

        ... Process Results ...

     }

}

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
March 7, 2018

No, that's not possible. You can do it if the user holds down Ctrl or Shift while clicking the field, though.