You can definitely convert SVG to EMF, for example this site . I wonder if this conversion can be achieved in C #?
Update:
I tried reading the SVG file using SVG.NET and drawing it in Graphics , and then tried to export Image as a MetaFile in the .emf extension (I followed the instructions here: GDI + / C #: how to save the image as EMF? ). The read was successful, and the image was exported as .emf. However, when I opened this .emf in PowerPoint, it could not have been ungrouped, which indicated that the drawing information for this file was not actually reset correctly.
Update 2:
Now it exports ungroup-able.emf, but ungrouping shows a very bad result. I used the following code to create .emf:
private void OpenPictureButtonClick(object sender, EventArgs e) { var openFileDialog = new OpenFileDialog(); openFileDialog.ShowDialog(); _svgDoc = SvgDocument.Open(openFileDialog.FileName); RenderSvg(_svgDoc); } private void SavePictureClick(object sender, EventArgs e) { var saveFileDialog = new SaveFileDialog {Filter = "Enhanced Meta File | *.Emf"}; saveFileDialog.ShowDialog(); var path = saveFileDialog.FileName; var graphics = CreateGraphics(); var img = new Metafile(path, graphics.GetHdc()); var ig = Graphics.FromImage(img); _svgDoc.Draw(ig); ig.Dispose(); img.Dispose(); graphics.ReleaseHdc(); graphics.Dispose(); } private void RenderSvg(SvgDocument svgDoc) { svgImageBox.Image = svgDoc.Draw(); }
source share