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
A shape to add to the page.
- nPage
number
null The page number.
The X coordinate in English measure units.
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);