Javascript: TXTextControl.setPageUnit Method
Description
Sets the measure used for page sizes and page margins.
Syntax
<void> TXTextControl.setPageUnit(<MeasuringUnit> pageUnit, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| pageUnit | the measure used for page sizes and page margins. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TXTextControl.setPageUnit in a practical document-editing workflow. It sets the measure used for page sizes and page margins.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.setPageUnit(
TXTextControl.MeasuringUnit.CentiInch,
function() {
console.log("set page unit completed.");
},
onTxError
);