ApiDrawing

class ApiDrawing

Description

Class representing a graphical object.

Instance Methods

GetClassType(): drawing

Returns a type of the ApiDrawing class.

SetSize(nWidth, nHeight)

Sets the size of the object (image, shape, chart) bounding box.

SetWrappingStyle(sType)

Sets the wrapping type of the current object (image, shape, chart).

SetHorAlign(sRelativeFrom, sAlign)

Specifies how the floating object will be horizontally aligned.

SetVerAlign(sRelativeFrom, sAlign)

Specifies how the floating object will be vertically aligned.

SetHorPosition(sRelativeFrom, nDistance)

Sets the absolute measurement for the horizontal positioning of the floating object.

SetVerPosition(sRelativeFrom, nDistance)

Sets the absolute measurement for the vertical positioning of the floating object.

SetDistances(nLeft, nTop, nRight, nBottom)

Specifies the minimum distance which will be maintained between the edges of the current drawing object and any subsequent text.

GetParentParagraph(): ApiParagraph | "null"

Returns a parent paragraph that contains the graphic object.

GetParentContentControl(): ApiBlockLvlSdt | "null"

Returns a parent content control that contains the graphic object.

GetParentTable(): ApiTable | "null"

Returns a parent table that contains the graphic object.

GetParentTableCell(): ApiTableCell | "null"

Returns a parent table cell that contains the graphic object.

Delete(): boolean

Deletes the current graphic object.

Copy(): ApiDrawing

Copies the current graphic object.

InsertInContentControl(nType): ApiDrawing | ApiBlockLvlSdt

Wraps the graphic object with a rich text content control.

InsertParagraph(paragraph, sPosition, beRNewPara): ApiParagraph | ApiDrawing

Inserts a paragraph at the specified position.

Select()

Selects the current graphic object.

AddBreak(breakType, position): boolean

Inserts a break at the specified location in the main document.

SetHorFlip(bFlip)

Flips the current drawing horizontally.

SetVertFlip(bFlip): boolean

Flips the current drawing vertically.

ScaleHeight(coefficient): boolean

Scales the height of the figure using the specified coefficient.

ScaleWidth(coefficient): boolean

Scales the width of the figure using the specified coefficient.

Fill(oFill): boolean

Sets the fill formatting properties to the current graphic object.

SetOutLine(oStroke): boolean

Sets the outline properties to the specified graphic object.

GetNextDrawing(): ApiDrawing | "null"

Returns the next inline drawing object if exists.

GetPrevDrawing(): ApiDrawing | "null"

Returns the previous inline drawing object if exists.

ToJSON(bWriteNumberings, bWriteStyles): JSON

Converts the ApiDrawing object into the JSON object.

GetWidth(): EMU

Returns the width of the current drawing.

GetHeight(): EMU

Returns the height of the current drawing.

GetLockValue(sType): bool

Returns the lock value for the specified lock type of the current drawing.

SetLockValue(sType, bValue): bool

Sets the lock value to the specified lock type of the current drawing.

SetDrawingPrFromDrawing(oAnotherDrawing): boolean

Sets the properties from another drawing to the current drawing.

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