TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

ApiImage

new ApiImage()

Class representing an image.

Methods

Name Description
GetClassType

Returns a type of the ApiImage class.

GetNextImage

Returns the next inline image if exists.

GetPrevImage

Returns the previous inline image if exists.

Example

Copy code
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);
var sClassType = oDrawing.GetClassType();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Class Type = " + sClassType);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "ApiImage.docx");
builder.CloseFile();

Resulting document