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

Free Support Forum - aspose.com

How to Export Multiple Shapes as an Image?

I know that I can convert an entire slide to an image with ISlide.GetThumbnail as well as a single shape with IShape.GetThumbnail. Now what I would like to do is converting a set of shapes to an image. Can anyone suggest the best way to do this?

One idea that I had was grouping the relevant shapes into one shape. But I know that PowerPoint won’t allow grouping placeholder shapes. Therefore I suspect Aspose will run into issues with this approach too.

Another option would be copying the shapes to an empty slide or emptying the slide (i.e. delete other shapes, reset background, clear layout page) and then export the entire slide. A limitation would be that the background won’t be transparent but white.

Maybe there’s a better way that I missed?

Thank you for posting the inquiry.

I’ve performed some research and found Aspose.Slides allows you to group placeholders but there are some issues related to this capability. I do not recommend using this yet. Perhaps this is a bug. I added a ticket with ID SLIDESNET-43049 in our issue tracking system. Our development team will investigate this case. You will be notified when the issue is resolved. Perhaps it will be disabled as well.

You are right. ISlide.GetThumbnail method does not allow you to make the slide background transparent yet. I’ve linked this forum thread to an appropriate task with ID SLIDESNET-34701 in our issue tracking system. You will be notified when this feature is implemented.

As a workaround, you can perform the following steps to implement your requirements:

  1. Find a necessary image size by positions and sizes of shapes.
  2. Create a Bitmap object with the size found earlier.
  3. Create a Graphics object from the Bitmap object.
  4. Use IShape.GetThumbnail method to get shape images with transparency.
  5. Draw the shape images on the Graphics object.

Thanks for the quick response @Andrey_Potapov. The suggested approach sounds interesting. I’ll try to get it to work.

Please be free to ask about any difficulties you will encounter using Aspose.Slides.

1 Like