ApiDocumentContent

class ApiDocumentContent

Description

Class representing a container for paragraphs and tables.

Instance Methods

GetClassType(): documentContent

Returns a type of the ApiDocumentContent class.

GetElementsCount(): number

Returns a number of elements in the current document.

GetElement(nPos): DocumentElement

Returns an element by its position in the document.

AddElement(nPos, oElement)

Adds a paragraph or a table or a blockLvl content control using its position in the document content.

Push(oElement): boolean

Pushes a paragraph or a table to actually add it to the document.

RemoveAllElements()

R.

RemoveElement(nPos)

Removes an element using the position specified.

GetRange(Start, End): ApiRange

Returns a Range object that represents the part of the document contained in the document content.

ToJSON(bWriteNumberings, bWriteStyles): JSON

Converts the ApiDocumentContent object into the JSON object.

GetContent(bGetCopies): []

Returns an array of document elements from the current ApiDocumentContent object.

GetAllDrawingObjects(): ApiDrawing[]

Returns a collection of drawing objects from the document content.

GetAllShapes(): ApiShape[]

Returns a collection of shape objects from the document content.

GetAllImages(): ApiImage[]

Returns a collection of image objects from the document content.

GetAllCharts(): ApiChart[]

Returns a collection of chart objects from the document content.

GetAllOleObjects(): ApiOleObject[]

Returns a collection of OLE objects from the document content.

GetAllParagraphs(): ApiParagraph[]

Returns an array of all paragraphs from the current document content.

GetAllTables(): ApiParagraph[]

Returns an array of all tables from the current document content.

Extends By

ApiDocumentApiDocumentContent

Class representing a document.

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).