AddImage
function AddImage(
sImageSrc: string = null,
nWidth: EMU = null,
nHeight: EMU = null,
nFromCol: number = null,
nColOffset: EMU = null,
nFromRow: number = null,
nRowOffset: EMU = null,
): ApiImage
Description
Adds an image to the current sheet with the parameters specified.
Parameters
- sImageSrc
string
null The image source where the image to be inserted should be taken from (currently only internet URL or Base64 encoded images are supported).
The image width in English measure units.
The image height in English measure units.
- nFromCol
number
null The number of the column where the beginning of the image will be placed.
The offset from the nFromCol column to the left part of the image measured in English measure units.
- nFromRow
number
null The number of the row where the beginning of the image will be placed.
The offset from the nFromRow row to the upper part of the image measured in English measure units.
Returns
ApiImage
Try It
var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 60 * 36000, 35 * 36000, 0, 2 * 36000, 0, 3 * 36000);