BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
I would like to implement customized contextMenu when user selects text and presses right mouse button. I have found some information bits, but haven't succeeded, here is my attempt:
<ejs-pdfviewer id="pdfviewer" serviceUrl="/api/PdfViewer" enableToolbar="true"
documentPath="PDF_Succinctly.pdf"
contextMenuSettings="@(new Syncfusion.EJ2.PdfViewer.PdfViewerContextMenuSettings
{ ContextMenuItems = new string[] {"ItemA", "ItemB" },
})"
</ejs-pdfviewer>
This does not work and I am not sure if I have use wrong syntax or this is not possible by design?
It is possible only to remove the items from the context menu and it is not possible to add new items or customized items.
Kindly find the sample and code snippet for removing the context menu items.
Code Snippet:
function documentLoaded(args) { var viewer = document.getElementById('pdfviewer').ej2_instances[0]; //viewer.contextMenuOption = 'None'; console.log(viewer); viewer.contextMenuSettings = { contextMenuAction: 'RightClick', contextMenuItems:[16,0]};
}; |
Kindly try this and let us know if you have any concerns.
Hi Visvesvar,
Thank you for the answer. Does this " and it is not possible to add new items or customized items " apply only to selected text context menu or also to selected annotations context menu?
Thank you for your update.
Yes, it is not possible to customize the context menu which are applicable to annotations. Text markup, and form fields.
Hi
Visvesvar,
Thank you for information. One last question - is this a limitation of ASP .NET Core version or is it like this across other platforms as well? If I remember correctly, I somewhere saw that Xamarin (not 100% sure) version had option to use custom menu items in pdfViewer.
Regards,
Janis
All the web platform components doesn't have this support. We will check the feasibility of considering this as a feature request and get back to you with further updates
on April 25, 2023.
Hi ArunKumar,
Thank you for the answer. We can close this ticket now.
Regards,
Janis
Thank you for your update. We are closing this ticket.