Api

class Api

Instance Methods

CreateRun(): ApiRun

Creates a new smaller text block to be inserted to the current paragraph or table.

CreateRGBColor(r, g, b): ApiRGBColor

Creates an RGB color setting the appropriate values for the red, green and blue color components.

CreateSchemeColor(sSchemeColorId): ApiSchemeColor

Creates a complex color scheme selecting from one of the available schemes.

CreatePresetColor(sPresetColor): ApiPresetColor

Creates a color selecting it from one of the available color presets.

CreateSolidFill(oUniColor): ApiFill

Creates a solid fill to apply to the object using a selected solid color as the object background.

CreateLinearGradientFill(aGradientStop, Angle): ApiFill

Creates a linear gradient fill to apply to the object using the selected linear gradient as the object background.

CreateRadialGradientFill(aGradientStop): ApiFill

Creates a radial gradient fill to apply to the object using the selected radial gradient as the object background.

CreatePatternFill(sPatternType, BgColor, FgColor): ApiFill

Creates a pattern fill to apply to the object using the selected pattern as the object background.

CreateBlipFill(sImageUrl, sBlipFillType): ApiFill

Creates a blip fill to apply to the object using the selected image as the object background.

CreateNoFill(): ApiFill

Creates no fill and removes the fill from the element.

CreateStroke(nWidth, oFill): ApiStroke

Creates a stroke adding shadows to the element.

CreateGradientStop(oUniColor, nPos): ApiGradientStop

Creates a gradient stop used for different types of gradients.

CreateBullet(sSymbol): ApiBullet

Creates a bullet for a paragraph with the character or symbol specified with the sSymbol parameter.

ReplaceTextSmart(arrString, sParaTab, sParaNewLine)

Replaces each paragraph (or text in cell) in the select with the corresponding text from an array of strings.

CreateTextPr(): ApiTextPr

Creates the empty text properties.

GetFullName(): string

Returns the full name of the currently opened file.

GetPresentation(): ApiPresentation

Returns the main presentation.

CreateMaster(oTheme): ApiMaster

Creates a new slide master.

CreateLayout(oMaster): ApiLayout

Creates a new slide layout and adds it to the slide master if it is specified.

CreatePlaceholder(sType): ApiPlaceholder

Creates a new placeholder.

CreateTheme(sName, oMaster, oClrScheme, oFormatScheme, oFontScheme): ApiTheme | "null"

Creates a new presentation theme.

CreateThemeColorScheme(arrColors, sName): ApiThemeColorScheme

Creates a new theme color scheme.

CreateThemeFormatScheme(arrFill, arrBgFill, arrLine, sName): ApiThemeFormatScheme

Creates a new theme format scheme.

CreateThemeFontScheme(mjLatin, mjEa, mjCs, mnLatin, mnEa, mnCs, sName): ApiThemeFontScheme

Creates a new theme font scheme.

CreateSlide(): ApiSlide

Creates a new slide.

CreateImage(sImageSrc, nWidth, nHeight): ApiImage

Creates an image with the parameters specified.

CreateOleObject(sImageSrc, nWidth, nHeight, sData, sAppId): ApiOleObject

Creates an OLE object with the parameters specified.

CreateShape(sType, nWidth, nHeight, oFill, oStroke): ApiShape

Creates a shape with the parameters specified.

CreateChart(sType, aSeries, aSeriesNames, aCatNames, nWidth, nHeight, nStyleIndex, aNumFormats): ApiChart

Creates a chart with the parameters specified.

CreateGroup(aDrawings): ApiGroup

Creates a group of drawings.

CreateTable(nCols, nRows): ApiTable

Creates a table.

CreateParagraph(): ApiParagraph

Creates a new paragraph.

Save()

Saves changes to the specified document.

CreateWordArt(oTextPr, sText, sTransform, oFill, oStroke, nRotAngle, nWidth, nHeight, nIndLeft, nIndTop): ApiDrawing

Creates a Text Art object with the parameters specified.

FromJSON(sMessage)

Converts the specified JSON object into the Document Builder object of the corresponding type.

attachEvent(eventName, callback)

Subscribes to the specified event and calls the callback function when the event fires.

detachEvent(eventName)

Unsubscribes from the specified event.

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