DS Server

Javascript: SectionFormat.setLandscape Method

Method|Introduced in 26.0

Description

Sets a value indicating whether the section's page size is in landscape orientation.

Syntax

<void> SectionFormat.setLandscape(<boolean> landscape, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
landscape

Indicates whether the section's page size is in landscape orientation.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates SectionFormat.setLandscape in a practical document-editing workflow. It sets a value indicating whether the section's page size is in landscape orientation.

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

function configureLandscape(sectionFormat) {
    sectionFormat.setLandscape(
        true,
        function() {
            console.log("set landscape completed.");
        },
        onTxError
    );
}