I’m integrating Groupdocs.Web.Annotations into a .NET web application. However, the toolbar is not showing up.
I have created a small demo application and the toolbar does show up in that application, just not my main one.
Here is the code on the cshtml page:
@Html.Groupdocs().AnnotationScripts().LoadJquery(false)
@(Html.Groupdocs()
.Annotation()
.ElementId(“annotation-widget”)
.FilePath(“Quick_Start_Guide_To_Using_GroupDocs.pdf”)
.Width(600)
.Height(800)
.ShowZoom(true)
.ShowPaging(true)
.ShowThumbnails(true)
.OpenThumbnails(false)
.ZoomToFitWidth(true)
//.Zoom(75)
.PreloadPageCount(3)
.EnableRightClickMenu(true)
.ShowFileExplorer(true)
.Tools(Groupdocs.Web.Annotation.AnnotationTools.All)
.ShowHeader(true)
.StrikeoutMode(Groupdocs.Common.StrikeoutToolMode.Remove))
And the generated BLOCKED SCRIPT
var annotationWidget = $(’#annotation-widget’).groupdocsAnnotation({
width: 600,
height: 800,
fileId: ‘Quick_Start_Guide_To_Using_GroupDocs.pdf’,
docViewerId: ‘annotation-widget-doc-viewer’,
quality: 90,
enableRightClickMenu: true,
showHeader: true,
showZoom: true,
showPaging: true,
showPrint: false,
showFileExplorer: true,
showThumbnails: true,
openThumbnails: false,
zoomToFitWidth: true,
zoomToFitHeight: false,
initialZoom: 100,
preloadPagesCount: 3,
enableSidePanel: true,
scrollOnFocus: true,
strikeOutColor: ‘’,
enabledTools: 255,
connectorPosition: 0,
saveReplyOnFocusLoss: false,
strikeoutMode: 1,
sideboarContainerSelector: ‘div.comments_sidebar_wrapper’,
usePageNumberInUrlHash: false,
textSelectionSynchronousCalculation: true,
variableHeightPageSupport: true,
useJavaScriptDocumentDescription: true,
isRightPanelEnabled: true,
createMarkup: true,
use_pdf: ‘true’,
_mode: ‘annotatedDocument’,
selectionContainerSelector: “[name=‘selection-content’]”,
graphicsContainerSelector: ‘.annotationsContainer’,
userName: ‘groupdocs@groupdocs.com’,userId: ‘3f8b6a5375337dae’
});
var annotationsViewer = $(annotationWidget).groupdocsAnnotation(‘getViewer’);
var annotationsViewerVM = $(annotationsViewer).groupdocsAnnotationViewer(‘getViewModel’);
You can see that enabledTools is 255 (all tools). However, annotationsViewerVM.canAnnotate() is false.
If I manually set canAnnotate(true) in the Chrome developer console, the toolbar appears as expected.
Any idea why I can’t see the toolbar?