Javascript: TXTextControl.getSupportedPaperSizes Method
Description
Gets an array of PaperSize structures specifying the names and the size of all currently supported paper sizes.
Syntax
<void> TXTextControl.getSupportedPaperSizes(<RequestPaperSizeCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the names and the size of all currently supported paper sizes. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TXTextControl.getSupportedPaperSizes in a practical document-editing workflow. It gets an array of PaperSize structures specifying the names and the size of all currently supported paper sizes.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.getSupportedPaperSizes(
function(paperSize) {
if (!paperSize) {
console.warn("No size was returned.");
return;
}
console.log("get supported paper sizes result:", paperSize);
},
onTxError
);