Javascript: ParagraphStyle.getParagraphFormat Method
Description
Gets the style's paragraph attributes.
Syntax
<void> ParagraphStyle.getParagraphFormat(<RequestParagraphFormatCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the style's paragraph attributes. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates ParagraphStyle.getParagraphFormat in a practical document-editing workflow. It gets the style's paragraph attributes.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectParagraphFormat(paragraphStyle) {
paragraphStyle.getParagraphFormat(
function(format) {
if (!format) {
console.warn("No paragraph format was returned.");
return;
}
console.log("get paragraph format result:", format);
},
onTxError
);
}