AddDrawingToPage

function AddDrawingToPage(oDrawing: ApiDrawing = null, nPage: number = null, x: EMU = null, y: EMU = null): boolean

Description

Adds a shape to the specified page. This method can be a little bit slow, because it runs the document calculation process to arrange tables on the specified page.

Parameters

oDrawingApiDrawingdefault: null

A shape to add to the page.

nPagenumberdefault: null

The page number.

xEMUdefault: null

The X coordinate in English measure units.

yEMUdefault: null

The Y coordinate in English measure units.

Returns

boolean

Try It

var oDocument = Api.GetDocument();
var oDrawing = Api.CreateImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 60 * 36000, 35 * 36000);
var oParagraph = Api.CreateParagraph();
oParagraph.AddPageBreak();
oDocument.Push(oParagraph);
oDocument.AddDrawingToPage(oDrawing, 1, 50 * 36000, 50 * 36000);

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