Skip to main content
Participating Frequently
May 28, 2025
Question

Can I add an option in Context menu in Adobe Acrobat page? Or how to handle events for ctrl +c/v

  • May 28, 2025
  • 1 reply
  • 214 views

I am working on a plugin which runs on Adobe Acrobat.
1. I need to copy a custom annotation ( Has image ) and should be able to paste in any page or any other opened pdf document page.  If I do ctrl +c and ctrl +v nothing happens. Checked the flags too it returns 4 which states "PrintAnnot" so the annot is not locked. Not sure if any thing more needs to be added in that annot. Because PDAnnotCanCopy returns false.

 

As of now, Manually creating the annotation by copying its appearance and rectangle. 


I have my code ready but how can I catch (Control + c and Control + v) events?


Code: 

AVAppRegisterForPageViewKeyDown(MyKeyDownHandler,NULL);
....
....


ASBool TTCPlugIn::MyKeyDownHandler(AVPageView pageView, AVKeyCode key, AVFlagBits16 modifiers, void* data)
{

if ((modifiers & AV_CONTROL) && ((key == 'C')||(key=='c')) )
{
// Handle Ctrl+C
AVAlertNote("Ctrl+C was pressed!");
return true; // Event handled
}
return false; 
}

This code works fine if I press C or c or any other alphabet. Doesnt gets triggered if I do a ctrl +c . 

Modifiers are 0 every time . 

 

 

2. Is it possible that I can add an option in context menu? 

AVAppRegisterForContextMenuAddition(ASAtomFromString("MY_MENU"), MyContextMenuAdditionProc, NULL);

 

 

void adddMe(void* S)
{
}

ACCB1 void ACCB2 MyContextMenuAdditionProc(ASAtom menuName, AVMenu menu, void* menuData, void* clientData) {
    // Check if it's the page view context menu
    if (ASAtomGetString(menuName) && strcmp(ASAtomGetString(menuName), "AVPageViewContextMenu") == 0) {
        AVMenuItem menuItem = AVMenuItemNew("My Custom Context Action",
            "NID_MY_CONTEXT_ACTION",
            NULL,
            false,
            0,
            0,
            NULL,
            gExtensionID);

        AVMenuItemSetExecuteProc(menuItem,
            ASCallbackCreateProto(AVExecuteProc, adddMe),
            NULL);

        AVMenuAddMenuItem(menu, menuItem, APPEND_MENUITEM);
    }
}

 

1 reply

creative explorer
Community Expert
Community Expert
July 2, 2025

@Sarvesh33782538lg9o Because you posted this in an Acrobat Reader discussion there is absolutely no direct way for users to add custom options to the context menu (right-click menu) or to programmatically handle keyboard events like Ctrl+C/V. Adobe Reader is designed primarily for viewing and basic interaction (filling forms, annotating).

m