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 theGetChildNodesmethod to select allShapenodes.
  • Iterate through resulting node collections.
  • Check theHasImageboolean property.
  • Extract image data using theImageDataproperty.
  • 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 toWMFformat while converting DOCX to RTF.

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