DS Server

ParagraphStyle Object

Object|Introduced in 28.0

Description

The ParagraphStyle class defines a formatting style for paragraphs.

Syntax

ParagraphStyle

Examples

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

PropertyDescription
listFormatThe paragraph style's bulleted or numbered list and/or its formatting attributes.
paragraphFormatThe paragraph style's paragraph attributes.

Methods

MethodDescription
applyApplies all set attributes of the style to the current document. (Inherited from FormattingStyle.)
getAutoBaselineGets 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.)
getBaselineGets the baseline alignment, in twips, of the style. (Inherited from FormattingStyle.)
getBaseStyleGets the FormattingStyle which is the base style of this style. (Inherited from FormattingStyle.)
getBoldGets the bold attribute of the style. (Inherited from FormattingStyle.)
getCapitalsGets 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.)
getCharacterScalingGets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.)
getCharacterSpacingGets 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.)
getCultureGets 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.)
getFollowingStyleGets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key.
getFontNameGets the font of the style. (Inherited from FormattingStyle.)
getFontSizeGets the font's size of the style. (Inherited from FormattingStyle.)
getForeColorGets the style's color used to display the text. (Inherited from FormattingStyle.)
getItalicGets the italic attribute of the style. (Inherited from FormattingStyle.)
getNameGets the name of the style. (Inherited from FormattingStyle.)
getParagraphFormatGets the style's paragraph attributes.
getStrikeoutGets the strikeout attribute of the style. (Inherited from FormattingStyle.)
getTextBackColorGets the style's text background color. (Inherited from FormattingStyle.)
getUnderlineGets the underlining styles for the style. (Inherited from FormattingStyle.)
setAutoBaselineSets 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.)
setBaselineSets the baseline alignment, in twips, of the style. (Inherited from FormattingStyle.)
setBoldSets the bold attribute of the style. (Inherited from FormattingStyle.)
setCapitalsSets 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.)
setCharacterScalingSets or sets the style's character scaling, in percent of the average character width. (Inherited from FormattingStyle.)
setCharacterSpacingSets 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.)
setCultureSets the culture as a languagecode2-country / regioncode2 string value. (Inherited from FormattingStyle.)
setFollowingStyleSets the name of the style that the document automatically uses for the following paragraph after the user has pressed the ENTER key.
setFontNameSets the font of the style. (Inherited from FormattingStyle.)
setFontSizeSets the font's size of the style. (Inherited from FormattingStyle.)
setForeColorSets the style's color used to display the text. (Inherited from FormattingStyle.)
setItalicSets the italic attribute of the style. (Inherited from FormattingStyle.)
setNameSets the name of the style. (Inherited from FormattingStyle.)
setStrikeoutSets the strikeout attribute of the style. (Inherited from FormattingStyle.)
setTextBackColorSets the style's text background color. (Inherited from FormattingStyle.)
setUnderlineSets the underlining styles for the style. (Inherited from FormattingStyle.)