Adding an Image Using Picture Frame with Aspose.Slides for Node.js

Hi Support,

I’m trying to add image using the below code but getting error. Can you please assist what I’m missing at line number 19.
image.png (40.8 KB)

@karanmarsh,
We have opened the following new ticket(s) in our internal issue tracking system and will consider the question according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNODEJS-45

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Please share code examples as text in the future.

@karanmarsh,
Please use the following code example:

var aspose = aspose || {};
var java = require('java');
aspose.slides = require("aspose.slides.via.java");

var presentation = new aspose.slides.Presentation();
var slide = presentation.getSlides().get_Item(0);

var imageStream = java.newInstanceSync("java.io.FileInputStream", "image.png");
var imgx = presentation.getImages().addImage(imageStream);

var pf = slide.getShapes().addPictureFrame(aspose.slides.ShapeType.Rectangle, 50, 50, imgx.getWidth(), imgx.getHeight(), imgx);

presentation.save("output_presentation.pptx", aspose.slides.SaveFormat.Pptx);
1 Like

Resolved. Thank you!

@karanmarsh,
Thank you for using Aspose.Slides.