Adds a shape to the specified page.
Name | Type | Description |
oDrawing | ApiDrawing | A shape to add to the page. |
nPage | number | The page number. |
x | EMU | The X coordinate in English measure units. |
y | EMU | The Y coordinate in English measure units. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); oParagraph.AddText("The drawing was added to the page №2."); var oSection1 = oDocument.CreateSection(oParagraph); oParagraph = Api.CreateParagraph(); oParagraph.AddText("Drawing"); oDocument.Push(oParagraph); var oSection2 = oDocument.CreateSection(oParagraph); var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61)); var oStroke = Api.CreateStroke(0, Api.CreateNoFill()); var oDrawing = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke); oDocument.AddDrawingToPage(oDrawing, 1, 1070821, 963295); builder.SaveFile("docx", "AddDrawingToPage.docx"); builder.CloseFile();