DS Server

EmbeddedFileCollection Object

Object|Introduced in 29.0

Description

Represents a collection of embedded files. To access the embedded files of a document use DocumentSettings.embeddedFiles.

Syntax

EmbeddedFileCollection

Examples

The following example demonstrates EmbeddedFileCollection in a practical document-editing workflow. It represents a collection of embedded files. To access the embedded files of a document use DocumentSettings.embeddedFiles.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const embeddedFiles = mainText.embeddedFiles;
    console.log("EmbeddedFileCollection object:", embeddedFiles);
}, onTxError);

Members

Methods

MethodDescription
addBinaryFileAdds an embedded binary file to the collection.
addTextFileAdds an embedded text file to the collection.
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
removeElementAtRemoves the embedded file at the given index.