We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Adding array of images to document


I want to add an array of images (dynamic length) to my document, all after each other with a bit of space between the images. How can I achieve this? How can I pass this array of images in my object array data and how can I handle it in a FieldMergingCallback?


Thanks for your inquiry. You need to iterate over array of images and use DocumentBuilder.InsertImage method to insert the image into document. Please call DocumentBuilder.InsertParagraph method after inserting each image for space between two images. Please refer to the following article.
Inserting an Image

Hope this helps you.

An how can I pass this as an argument? the array of images?


Thanks for your inquiry. Unfortunately, there is no method that takes array of images as argument. Please check the overloads of DocumentBuilder.InsertImage method. Please use the suggested solution shared in my previous post.