As in Excel Js, I need to add a base64 image into shape and set the name, alternate text, and size. I tried to use setSelectedDataAsync, but it is very limited and it is not possible to get the selec...
Troy_Bigelow
Sep 16, 2024Brass Contributor
Hey justingreywolf,
The rectangle provides the size and location of the shape of the SVG image that is being inserted. Here's a link to the SetSelectedDataOptions parameter that describes the properties in more detail...
https://learn.microsoft.com/en-us/javascript/api/office/office.setselecteddataoptions?view=common-js-preview
Here's my sample call...
async fillSlot(fileInfo, play, options) {
const currentShapeId = this.#shapeId;
const shapeId = await this.#insertDrawing(this.#slideId, play.drawingAsSVG, play.rect);
await this.#initializeNewDrawing(shapeId, fileInfo, false, false);
ShapeHelper.deleteShape(this.#slideId, currentShapeId);
return shapeId;
}
Hope that helps, Cheers!
Troy