Replaces the current image with an image specified.
Name | Type | Description |
sImageUrl | string | The image source where the image to be inserted should be taken from (currently, only internet URL or Base64 encoded images are supported). |
Width | EMU | The image width in English measure units. |
Height | EMU | The image height in English measure units. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); var oDrawing = Api.CreateImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 60 * 36000, 35 * 36000); oParagraph.AddDrawing(oDrawing); oDrawing.Select(); oDocument.ReplaceCurrentImage("https://helpcenter.onlyoffice.com/images/Help/GettingStarted/Documents/big/EditDocument.png", 60 * 36000, 35 * 36000); builder.SaveFile("docx", "ReplaceCurrentImage.docx"); builder.CloseFile();