Documents can be loaded with the
initialDoc option will not work for collaboration purposes
This function has the same API as WebViewer's loadDocument function, so you can just swap the object you call it on from the Webviewer Instance to your CollabClient instance.
doc(Blob | File | URL) the document to load
options(LoadDocumentOptions) load document options. See the options section below for requirements.
This function will load the document and its annotations into the viewer. It will also subscribe to realtime events that happen on this document (new annotations, new users, etc).
If the ID provided does not exist in the database, a new collaboration session will be created using that ID.
The function returns a promise that resolves with the documents ID and name.
When loading a document, it is important to pass the documentId option.
documentId in the options let the client know which annotations, memberships, etc it needs to load from the database for that specific document.
documentId is provided but does not exist in the database, a collaboration session will be created using that ID.
documentId is not provided at all, a new collaboration session will be created using a generated ID.
The client will do its best to extract a name from the document you provide, however in certain scenarios it is not possible to get a file name.
It is recommended to pass the
filename option to the loadDocument function as well.
If you are calling
loadDocument for for the first time using this ID (aka creating a document), this will set whether or not the document is public. The default value is
This property is only used when creating new documents. It is ignored for existing documents.