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

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

New Here ,
Mar 07, 2018 Mar 07, 2018

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?

TOPICS
Acrobat SDK and JavaScript
628
Translate
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 , Mar 07, 2018 Mar 07, 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 ...

     }

}

Translate
Community Expert ,
Mar 07, 2018 Mar 07, 2018

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

Translate
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 ,
Mar 07, 2018 Mar 07, 2018
LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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