ParagraphStyle Object
Description
The ParagraphStyle class defines a formatting style for paragraphs.
Syntax
ParagraphStyleExamples
The following example demonstrates ParagraphStyle in a practical document-editing workflow. The ParagraphStyle class defines a formatting style for paragraphs.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectParagraphStyle(paragraphStyle) {
paragraphStyle.getFollowingStyle(
function(result) {
console.log("get following style result:", result);
},
onTxError
);
}Members
Properties
| Property | Description |
|---|---|
| listFormat | The paragraph style's bulleted or numbered list and/or its formatting attributes. |
| paragraphFormat | The paragraph style's paragraph attributes. |
Methods
| Method | Description |
|---|---|
| apply | Applies all set attributes of the style to the current document. (Inherited from FormattingStyle.) |
| getAutoBaseline | Gets values specifying automatic sub- or superscripted text. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the Baseline property. (Inherited from FormattingStyle.) |
| getBaseline | Gets the baseline alignment, in twips, of the style. (Inherited from FormattingStyle.) |
| getBaseStyle | Gets the FormattingStyle which is the base style of this style. (Inherited from FormattingStyle.) |
| getBold | Gets the bold attribute of the style. (Inherited from FormattingStyle.) |
| getCapitals | Gets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps). (Inherited from FormattingStyle.) |
| getCharacterScaling | Gets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.) |
| getCharacterSpacing | Gets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended. (Inherited from FormattingStyle.) |
| getCulture | Gets the culture as a languagecode2-country / regioncode2 string value. Takes a callback function as a parameter which is called with a languagecode2-country / regioncode2 string ("de-DE", "en-US" or "en", for example) as a parameter upon receiving the culture value. (Inherited from FormattingStyle.) |
| getFollowingStyle | Gets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key. |
| getFontName | Gets the font of the style. (Inherited from FormattingStyle.) |
| getFontSize | Gets the font's size of the style. (Inherited from FormattingStyle.) |
| getForeColor | Gets the style's color used to display the text. (Inherited from FormattingStyle.) |
| getItalic | Gets the italic attribute of the style. (Inherited from FormattingStyle.) |
| getName | Gets the name of the style. (Inherited from FormattingStyle.) |
| getParagraphFormat | Gets the style's paragraph attributes. |
| getStrikeout | Gets the strikeout attribute of the style. (Inherited from FormattingStyle.) |
| getTextBackColor | Gets the style's text background color. (Inherited from FormattingStyle.) |
| getUnderline | Gets the underlining styles for the style. (Inherited from FormattingStyle.) |
| setAutoBaseline | Sets values specifying automatic sub- or superscripted text. When using automatic sub- and superscript the font is scaled and moved above or below the baseline with values defined through the font itself. Automatic sub- and superscript can be combined with a user-defined baseline which can be set with the Baseline property. (Inherited from FormattingStyle.) |
| setBaseline | Sets the baseline alignment, in twips, of the style. (Inherited from FormattingStyle.) |
| setBold | Sets the bold attribute of the style. (Inherited from FormattingStyle.) |
| setCapitals | Sets values specifying wheather lowercase letters are displayed with capital letters. Lowercase letters are displayed either with capital letters of the same size or with capital letters which have a smaller size. The smaller size is either the size of the lowercase 'x' (petite caps) or the size of the lowercase 'x' + 10% (small caps). (Inherited from FormattingStyle.) |
| setCharacterScaling | Sets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.) |
| setCharacterSpacing | Sets the style's character spacing value, in twips. This value is added to each character. When it is negative, character spacing is reduced, otherwise it is extended. (Inherited from FormattingStyle.) |
| setCulture | Sets the culture as a languagecode2-country / regioncode2 string value. (Inherited from FormattingStyle.) |
| setFollowingStyle | Sets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key. |
| setFontName | Sets the font of the style. (Inherited from FormattingStyle.) |
| setFontSize | Sets the font's size of the style. (Inherited from FormattingStyle.) |
| setForeColor | Sets the style's color used to display the text. (Inherited from FormattingStyle.) |
| setItalic | Sets the italic attribute of the style. (Inherited from FormattingStyle.) |
| setName | Sets the name of the style. (Inherited from FormattingStyle.) |
| setStrikeout | Sets the strikeout attribute of the style. (Inherited from FormattingStyle.) |
| setTextBackColor | Sets the style's text background color. (Inherited from FormattingStyle.) |
| setUnderline | Sets the underlining styles for the style. (Inherited from FormattingStyle.) |