new BlackBoxAnnotationManager()
⚠ You must NOT instantiate this yourself. Access the annotation manager instance as follows:
Examples
// In your app
var viewer = new PDFTron.WebViewer({ ... }, viewerElement);
viewerElement.addEventListener('ready', function() {
var instance = viewer.getInstance();
var docViewer = instance.docViewer;
var annotManager = docViewer.getAnnotationManager();
// annotManager.someAPI();
});
// In a config file
$(document).on('viewerLoaded', function() {
var instance = readerControl;
var docViewer = instance.docViewer;
var annotManager = docViewer.getAnnotationManager();
// annotManager.someAPI();
});
Methods
-
disableCollaboration()
-
Disables collaboration by closing the annotation server connection.
-
initiateCollaboration(The)
-
Opens a connection to the annotation server and sets up collaboration.
Parameters:
Name Type Description Thestring document ID of the object to intiate annotation collaboration on.
-
preloadAnnotations(An)
-
Preloads existing annotations made without realtime collaboration enabled, will only trigger once on initial collaboration enabling event.
Parameters:
Name Type Description Anarray array of annotation objects.
Events
-
blackBoxAnnotationsDisabled
-
Triggered when collaboration has abruptly closed or been disabled. Attach like bbAnnotManager.on('blackBoxAnnotationsDisabled', callback)
Parameters:
Name Type Description evtobject Event object
-
blackBoxAnnotationsEnabled
-
Triggered when collaboration is enabled for blackbox. Attach like bbAnnotManager.on('blackBoxAnnotationsEnabled', callback)
Parameters:
Name Type Description eventobject Event object
thestring user name as specified by blackbox collaboration.
thestring user ID as specified by blackbox collaboration.