DS Server

Javascript: TextFrame.getTransparency Method

Method|Introduced in 28.0

Description

Gets the text frame's transparency. Zero means opaque and 1.0 means completely transparent.

Syntax

<void> TextFrame.getTransparency(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the current property value.

errorCallback

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

Examples

The following example demonstrates TextFrame.getTransparency in a practical document-editing workflow. It gets the text frame's transparency. Zero means opaque and 1.0 means completely transparent.

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

function inspectTransparency(textFrame) {
    textFrame.getTransparency(
        function(result) {
            console.log("get transparency result:", result);
        },
        onTxError
    );
}