Javascript: FormattingStyle.apply Method
Description
Applies all set attributes of the style to the current document.
Syntax
<void> FormattingStyle.apply([<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates FormattingStyle.apply in a practical document-editing workflow. Applies all set attributes of the style to the current document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function apply(formattingStyle) {
formattingStyle.apply(
function() {
console.log("apply completed.");
},
onTxError
);
}