Document

Document object, represents an opened document in the editor

Document

Classes

Document

Methods

async filePath() → {string}

Get local file path of the document, in utf8
Throws:
If document is not valid
Returns:
string - local file path
Since:
  • 22.07

async getAnnotations() → {Array.<Annotation>}

Get Annotations that is shown for current document Only the annotation set by your web-component will be returned.
Returns:
Array.<Annotation>
Since:
  • 22.11

async getClusterNodeID() → {ClusterNodeID}

Get cluster node ID of the document
Throws:
if document is not valid
Returns:
ClusterNodeID
Since:
  • 22.11

async getPlacedSDFilePaths() → {Array.<String>}

Get the file paths of the placed structural design files
Returns:
Array.<String> - The placed SD file paths.
Since:
  • 23.07

async hasPDFAnnotation() → {bool}

Return whether current document has any native PDF annotation
Returns:
bool
Since:
  • 23.11

async isDirty() → {bool}

Return whether the current document is dirty or not
Returns:
bool
Since:
  • 22.11

async pageNumber() → {int}

Get active page number of the document
Throws:
if document is not valid
Returns:
int
Since:
  • 23.07

async pagesInfo() → {Array.<PageInfo>}

Get pages info for the current document
Returns:
Array.<PageInfo>
Since:
  • 22.11

async readFileBinary(params) → {Uint8Array}

Get File as Binary
Parameters:
Name Type Description
params object optional
Properties
Name Type Description
clusterNodeID ClusterNodeID optional parameter, the clusterNodeID to be written in the temp exported binary file. This doesn't affect the current working document.
Returns:
Uint8Array - Uint8Array of the file binary
Since:
  • 22.11

async readPlacedSDFileBinary(filePath) → {Uint8Array}

Get the file byte stream of the placed structural design file
Parameters:
Name Type Description
filePath String SD file path
Returns:
Uint8Array - Uint8Array of the file binary
Since:
  • 23.07

async saveDocument(params)

Save the current document
Parameters:
Name Type Description
params object optional
Properties
Name Type Description
silent bool save file silently
Since:
  • 22.11

async setAnnotations(annotations) → {undefined}

Set Annotations that should be shown for current document
Parameters:
Name Type Description
annotations Array.<Annotation>
Returns:
undefined
Since:
  • 22.07

async setClusterNodeID(clusterNodeID) → {undefined}

Set cluster node ID to the document (This will not trigger a file save operation)
Parameters:
Name Type Description
clusterNodeID ClusterNodeID document cluster nodeID
Throws:
if document is not valid
Returns:
undefined
Since:
  • 22.11

async title() → {string}

Get Title of the document, in utf8
Throws:
if document is not valid
Returns:
string
Since:
  • 22.11