Convert EMF to Drawing Objects

Hi There,

I would like to import an EMF file and convert that PictureFrame to drawing objects.

In Powerpoint there is a way to do that:

  • Select EMF Image
  • Right Click -> Group -> Ungroup
  • “This is an imported picture, not a group. Do you want to convert it to a Microsoft Office drawing objects” -> Click Yes

But I would like to do that in Aspose.Slides:

....
var bytes = File.ReadAllBytes("my_file.emf");
var emfImage = pres.Images.AddImage(bytes);
IPictureFrame frame = Slide.gSlide.Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, emfImage.Width, emfImage.Height, emfImage);
....
//CONVERT FRAME TO DRAWING OBJECTS OR UNGROUP IT
....

Is there any way to do that programmatically ?

Many thanks,
Marius W.

@Dejab,

I have observed your comments. I have shared sample code with you. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

 pres = new Presentation();
        var bytes = File.ReadAllBytes("test.emf");
        var emfImage = pres.Images.AddImage(bytes);
    IPictureFrame frame = pres.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, emfImage.Width, emfImage.Height, emfImage);

        IShape shape = pres.Slides[0].Shapes[pres.Slides[0].Shapes.Count - 1];
        shape.GetThumbnail(ShapeThumbnailBounds.Shape, 1,1) .Save("tteesstt.png", ImageFormat.Emf);
        Process.Start("tteesstt.png");

Hi There,

Many thanks but that’s not really helping. Now I have a png file of my emf image.

I would like to ungroup that emf shape object with Aspose.Slides to get multiple objects.

In the end I would like to import a SVG Image to powerpoint to have multiple objects to edit that.

I have found a way to convert SVG to EMF and now i will import that EMF file and ungroup it programmatically to have multiple objects to edit them.

Many Thanks,
Marius W.

@Dejab,

I have observed your last post where by you have mentioned that you need to import SVG image to PowerPoint. I suggest you to please visit documentation article, Import SVG in slide. You can also export slide to SVG as well, if that is also a requirement on your end.

Hi There,

Many Thanks - I see that article a few days earlier.
It helps - but not a 100% solution.

I would like to have multiple drawing objects of this SVG file.

If i import that SVG File with Shapes.AddPictureFrame i have one big objects.
I would like to ungroup that shape programmatically to multiple objects.

i have shared two powerpoint files with you.
one of them has ONE big EMF Objects and the other has multiple objects.

Archiv.zip (58.6 KB)

And this i would like to do programmatically.

You know what i mean ?

Many Thanks,
Marius W.

@Dejab,

I have observed the requirements shared by you and regret to share that requested support is presently unavailable in Aspose.Slides. An issue with ID SLIDESNET-39754 has been created in our issue tracking system to investigate the possibility of implementing requested support. This thread has been linked with the issue so that you may be automatically notified one the support will be available.