ApiParagraph

class ApiParagraph extends ApiParaPr

Description

Class representing a paragraph.

Instance Methods

GetClassType(): paragraph

Returns a type of the ApiParagraph class.

AddText(sText): ApiRun

Adds some text to the current paragraph.

AddLineBreak(): ApiRun

Adds a line break to the current position and starts the next element from a new line.

GetParaPr(): ApiParaPr

Returns the paragraph properties.

GetElementsCount(): number

Returns a number of elements in the current paragraph.

GetElement(nPos): ParagraphContent

Returns a paragraph element using the position specified.

RemoveElement(nPos)

Removes an element using the position specified.

RemoveAllElements()

Removes all the elements from the current paragraph.

Delete(): boolean

Deletes the current paragraph.

GetNext(): ApiParagraph | "null"

Returns the next paragraph.

GetPrevious(): ApiParagraph

Returns the previous paragraph.

Copy(): ApiParagraph

Creates a paragraph copy.

AddElement(oElement, nPos): boolean

Adds an element to the current paragraph.

AddTabStop(): ApiRun

Adds a tab stop to the current paragraph.

SetIndLeft(nValue)

Sets the paragraph left side indentation.

GetIndLeft()

Returns the paragraph left side indentation.

SetIndRight(nValue)

Sets the paragraph right side indentation.

GetIndRight()

Returns the paragraph right side indentation.

SetIndFirstLine(nValue)

Sets the paragraph first line indentation.

GetIndFirstLine()

Returns the paragraph first line indentation.

SetJc(sJc)

Sets the paragraph contents justification.

GetJc()

Returns the paragraph contents justification.

SetSpacingLine(nLine, sLineRule)

Sets the paragraph line spacing.

GetSpacingLineValue()

Returns the paragraph line spacing value.

GetSpacingLineRule()

Returns the paragraph line spacing rule.

SetSpacingBefore(nBefore, isBeforeAuto)

Sets the spacing before the current paragraph.

GetSpacingBefore()

Returns the spacing before value of the current paragraph.

SetSpacingAfter(nAfter, isAfterAuto)

Sets the spacing after the current paragraph.

GetSpacingAfter()

Returns the spacing after value of the current paragraph.

SetTabs(aPos, aVal)

Specifies a sequence of custom tab stops which will be used for any tab characters in the current paragraph.

SetBullet(oBullet)

Sets the bullet or numbering to the current paragraph.

SetOutlineLvl(nLvl)

Sets the outline level for the specified properties.

GetOutlineLvl()

Gets the outline level of the specified properties.

Extends

ApiParaPr

Class representing the paragraph properties.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).