Skip to main content
A newer version of this page is available. .

ParagraphProperties Class

Contains paragraph properties.

Declaration

export class ParagraphProperties

Properties

alignment Property

Specifies the paragraph alignment.

Declaration

alignment: ParagraphAlignment

Property Value

Type Description
ParagraphAlignment

The paragraph alignment.

backColor Property

Specifies the paragraph background color.

Declaration

backColor: string

Property Value

Type Description
string

The background color.

contextualSpacing Property

Specifies whether to remove an additional space (contextual spacing) between paragraphs of the same style.

Declaration

contextualSpacing: boolean

Property Value

Type Description
boolean

true to remove extra space between paragraphs, false to add extra space.

Remarks

To mark the change from one paragraph to another, the line spacing is increased. To prevent this behavior, set the contextualSpacing to true.

firstLineIndent Property

Specifies the indent for the first line in a paragraph.

Declaration

firstLineIndent: number

Property Value

Type Description
number

The indent for the first line, in twips.

Remarks

If the firstLineIndentType property is set to a value different from None, the indent value of a paragraph is specified by its firstLineIndent property.

firstLineIndentType Property

Specifies whether and how the first line in a paragraph is indented.

Declaration

firstLineIndentType: ParagraphFirstLineIndent

Property Value

Type Description
ParagraphFirstLineIndent

The first line’s indent.

Remarks

If the firstLineIndentType property is set to a value different from None, the indent value of a paragraph is specified by its firstLineIndent property.

keepLinesTogether Property

Specifies whether all lines in a paragraph should appear on the same page.

Declaration

keepLinesTogether: boolean

Property Value

Type Description
boolean

true, to keep paragraph lines together; otherwise, false.

Remarks

Set the keepLinesTogether property to true to prevent all page breaks that interrupt a paragraph. If paragraph lines do not fit on the current page, the whole paragraph is moved to the next page.

leftIndent Property

Specifies the left indent for a paragraph.

Declaration

leftIndent: number

Property Value

Type Description
number

The left indent, in twips, or undefined to indicate a mix of values.

lineSpacing Property

Specifies a line spacing value.

Declaration

lineSpacing: number

Property Value

Type Description
number

The line spacing, in twips, or undefined to indicate a mix of values.

lineSpacingType Property

Specifies the type of spacing between lines in a paragraph.

Declaration

lineSpacingType: ParagraphLineSpacingType

Property Value

Type Description
ParagraphLineSpacingType

The line spacing type.

outlineLevel Property

Specifies the outline level of a paragraph.

Declaration

outlineLevel: number

Property Value

Type Description
number

The level number, or undefined to indicate a mix of values.

pageBreakBefore Property

Specifies whether to insert a page break before the specified paragraph.

Declaration

pageBreakBefore: boolean

Property Value

Type Description
boolean

true if a page break is inserted before a paragraph; otherwise, false or undefined, for a mixture of true and false.

rightIndent Property

Specifies the right indent for a paragraph.

Declaration

rightIndent: number

Property Value

Type Description
number

The right indent, in twips, or undefined to indicate a mix of values.

spacingAfter Property

Specifies the spacing after a paragraph.

Declaration

spacingAfter: number

Property Value

Type Description
number

The spacing after a paragraph, in twips, or undefined to indicate a mix of values.

spacingBefore Property

Specifies the spacing before a paragraph.

Declaration

spacingBefore: number

Property Value

Type Description
number

The spacing before a paragraph, in twips, or undefined to indicate a mix of values.