Which product are you using?
PDF.js Express Plus
PDF.js Express Version
8.x.x.x
Detailed description of issue
Am working on custom annotation, onclick of button need to get popup with input fields
Expected behaviour
on click of the custom annotation button i need one popup with input field, below that some text fields
Does your issue happen with every document, or just one?
Yes
Link to document
{Provide a link to the document in question if possible}
Code snippet
useEffect(() => {
WebViewer(
{
path: ‘/webviewer/lib’,
}, viewer.current).then(async instance => {
const {Core} = instance;
//Initially load Document
instance.UI.loadDocument(myBase64String);
//to load Annotations
Core.documentViewer.addEventListener('documentLoaded', async () => {
const xfdfString = localStorage.getItem("Annotations");
instance.Core.annotationManager.importAnnotations(xfdfString);
});
// For Pop Up
instance.UI.contextMenuPopup.update([
{
type: 'actionButton',
label: 'Annotate',
tooltip: 'Annotate',
onClick: () => {
callAnnotations(instance);
}
}
]);
}) //End of WebView
}, []);
function callAnnotations(instance) {
console.log(“In callAnnotations”)
//For Form Fields
instance.UI.contextMenuPopup.update([
{
label: ‘Annotate’,
tooltip: ‘Annotate’,
onClick: () => {
handleShow(instance);
}
}
]);