I started experimenting with Open XML SDK 2.0 for Microsoft Office.
I’m currently able to do certain things such as retrieve all texts in each slide, and get the size of the presentation. For example, I do the latter this way:
using (var doc = PresentationDocument.Open(pptx_filename, false)) {
var presentation = doc.PresentationPart.Presentation;
Debug.Print("width: " + (presentation.SlideSize.Cx / 9525.0).ToString());
Debug.Print("height: " + (presentation.SlideSize.Cy / 9525.0).ToString());
}
Now I’d like to retrieve embedded images in a given slide. Does anyone know how to do this or can point me to some docs on the subject?
First you need to grab the
SlidePartin which you want to get the images from:Then you need to search for the
Pictureobject which will contain the image you are looking for based on the file name of the image: