How to Initialize and destroy GroupDoc Annotation component using client side code


#1

Just like GroupDocs Viewer, how to initialize and destroy Group Docs Annotation Control using client side code ?

In GroupDocs Viewer we can initialize it by following code
var viewer = $(’#attachment-viewer’);
viewer.groupdocsViewer({
zoomToFitWidth: false,
showZoom: true,
showFolderBrowser: false,
showHeader: true,
showPaging: true,
useHtmlBasedEngine: false,
quality: 100,
zoom:1000,
showDocumentNavigation: true,
printWithWatermark: true,
enableStandardErrorHandling: false,
preloadPagesCount: 1,
});

In GroupDocs Viewer we can load document by following client side code
var viewer = $(’#attachment-viewer’);
viewer.groupdocsViewer(“loadDocument”, result.filepath);

In GroupDocs Viewer we can unload or destroy component by following client side code

var viewer = $(’#attachment-viewer’);
viewer.groupdocsViewer(“destroy”);

So please provide any mechanism to initialize,load and destroy annotation from client side code.

I have GroupDocs Total License and I am using version 17.7.0

Thanks,
Jayesh Dharade


#2

@jayesh.dharade,

Thanks for your inquiry.

You can achieve your use case using iframe. If you want to utilize GroupDocs.Annotation in new or existing application, define iframe in HTML or through script and pass URL of GroupDocs.Annotation UI as its source.
<iframe id="myframe" src="http://localhost:36510"></iframe>
And to load a file initially, pass file name to the file parameter of source URL.
<iframe id="myframe" src="http://localhost:36510/?file=Test.pdf"></iframe>

To destroy, you can simply remove the source of iframe or remove iframe from HTML.

Please let us know if you have further queries.