Javascript: ParagraphFormat.setWidowOrphanLines Method
Description
Sets the number of lines for widow/orphan control.
Syntax
<void> ParagraphFormat.setWidowOrphanLines(<number> lines, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| lines | The number of lines for widow/orphan control. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates ParagraphFormat.setWidowOrphanLines in a practical document-editing workflow. It sets the number of lines for widow/orphan control.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.paragraphFormat.setWidowOrphanLines(
1,
function() {
console.log("set widow orphan lines completed.");
},
onTxError
);