Which product are you using?
PDF.js Express Plus
PDF.js Express Version
8
Detailed description of issue
I am able to hide annotation button even though annotate button is clicked, when we are importing xfdf data back to pdf. but i am not able to disable the annotate toolbar, i have coded like this,
Expected behaviour
when the annotate button is hidden, i should not be able to even draw annotation box in the pdf
Does your issue happen with every document, or just one?
{Answer here}
yes
Link to document
{Provide a link to the document in question if possible}
Code snippet
{Provide a relevant code snippet}
this.setAnnotationEvent.subscribe(() => {
//instance.UI.setToolbarGroup('toolbarGroup-Insert');
const annotationsList = annotationManager.getAnnotationsList();
const xfdfString = this.renderingInstance;
annotationManager.importAnnotations(xfdfString);
this.renderingInstance = '';
let isChecked: any = [...this.annotationList.filter((ele: any) => ele.checked)];
if (isChecked.length > 0) {
if (instance.UI.getToolMode().name === 'AnnotationCreateRectangle') {
instance.UI.disableElements(['annotationStyleEditButton']);
}
instance.UI.disableElements(['ribbons']);
instance.UI.disableElements(['toolbarGroup-Annotate']);
instance.UI.disableElements(['annotationStyleEditButton']);
} else {
instance.UI.enableElements(['ribbons']);
instance.UI.enableElements(['toolbarGroup-Annotate']);
instance.UI.enableElements(['annotationStyleEditButton']);
}
//instance.UI.setToolbarGroup('toolbarGroup-Insert');
});