DS Server

Javascript: ParagraphFormat.getFrame Method

Method|Introduced in 26.0

Description

Gets the framesetting of the paragraph.

Syntax

<void> ParagraphFormat.getFrame(<RequestFrameCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the frame setting of the paragraph.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates ParagraphFormat.getFrame in a practical document-editing workflow. It gets the framesetting of the paragraph.

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

TXTextControl.paragraphFormat.getFrame(
    function(frame) {
        if (!frame) {
            console.warn("No frame was returned.");
            return;
        }
        
        console.log("get frame result:", frame);
    },
    onTxError
);

Remarks

The property's default value is Frame.None. The property returns its default value when the text selection contains multiple paragraphs with mixed frames. The Selection.getIsCommonValueSelected method can be used to check for mixed attributes.