I am using openxml sdk to read and manipulate docx.
I am able to iterate through all the images found in a docx and my task is to replace all the wmf/emf images into png or jpg.
string sourceFile="@D:\temp\sample.docx"; using (WordprocessingDocument myDocument = WordprocessingDocument.Open(sourceFile, true)) { var imageParts = myDocument.MainDocumentPart.ImageParts; foreach (ImagePart imagePart in imageParts) { var uri = imagePart.Uri; var filename = uri.ToString().Split('/').Last(); if (imagePart.ContentType.Equals("image/x-wmf")) { Image img = Image.FromStream(imagePart.GetStream()); /* Now I need to convert the image format from WMF or EMF to PNG and replace the output in all the xml. */ } } }