Skip to main content
Participating Frequently
January 31, 2024
Question

disable comments sidebar -PDF Embed API

  • January 31, 2024
  • 1 reply
  • 1005 views

I want to disable comments in sidebar

Setting showAnnotationTools: false solves it but it disables PDF annotations altogether, I need a way to disable the comments sidebar only. 
is there a way to do this?

This topic has been closed for replies.

1 reply

Raymond Camden
Community Manager
Community Manager
February 1, 2024

Looking at the docs in regards to customization (https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/howtos_ui/), I don't believe so, but you should check the doc there to be sure.

Participating Frequently
February 4, 2024

@Raymond Camden I checked and tried this code but it doesn't work 
const customFlags = {
showToolbar: true,
showCommentsPanel: false,
showToolsOnTextSelection: false,
downloadWithAnnotations: false,
printWithAnnotations: false
}

adobeDCView.previewFile({
metaData:{fileName: "Bodea Brochure.pdf"}
}, {
}).then(adobeViewer => {
   adobeViewer.getAnnotationManager().then(annotationManager => {
 
       annotationManager.setConfig({ showCommentsPanel: false}) .then(() => console.log("Success"))
           .catch(error => console.log(error));
   });
})
Raymond Camden
Community Manager
Community Manager
February 5, 2024

In the second argument to previewFile, which you have empty, add:

enableAnnotationAPIs: true

 

You can see this here, https://codepen.io/cfjedimaster/pen/NWJzgva?editors=1011