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 The
string 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 An
array 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 evt
object Event object
-
blackBoxAnnotationsEnabled
-
Triggered when collaboration is enabled for blackbox. Attach like bbAnnotManager.on('blackBoxAnnotationsEnabled', callback)
Parameters:
Name Type Description event
object Event object
the
string user name as specified by blackbox collaboration.
the
string user ID as specified by blackbox collaboration.