Working with Images

Aspose.Words allows users to work with images in a very flexible way. In this article, you can explore only some of the possibilities of working with images.

How to Extract Images from a Document

All images are stored inside Shape nodes in a Document. To extract all images or images having a specific type from the document, follow these steps:

  • Use the GetChildNodes method to select all Shape nodes.
  • Iterate through resulting node collections.
  • Check the HasImage boolean property.
  • Extract image data using the ImageData property.
  • Save image data to a file.

The following code example shows how to extract images from a document and save them as files:

Saving Images as WMF

Aspose.Words provides functionality to save all the available images in a document to WMF format while converting DOCX to RTF.

The following code example shows how to save images as WMF with RTF save options: