Javascript: Image.getHorizontalScaling Method
Description
Gets an images's horizontal scaling factor in percent.
Syntax
<void> Image.getHorizontalScaling(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Image.getHorizontalScaling in a practical document-editing workflow. It gets an images's horizontal scaling factor in percent.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.images.getItem(function(image) {
if (!image) {
console.warn("No image is available at the current input position.");
return;
}
image.getHorizontalScaling(
function(result) {
console.log("get horizontal scaling result:", result);
},
onTxError
);
}, onTxError);