ImageOptions class

ImageOptions class

Provides options used for image extraction.

An instance of ImageOptions is used as a parameter in PageImageArea.get_image_stream(ImageOptions) and PageImageArea.save(str, ImageOptions) methods. See the usage examples there.

It is used to specify the image format for image extraction.

The ImageOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the ImageOptions class.

Properties

Property Description
image_format The image format for image extraction.

Example

from groupdocs.parser import Parser
from groupdocs.parser.options import ImageOptions, ImageFormat

parser = Parser("sample.docx")
image_area = parser.get_images()[0]

# Save images as JPEG
options = ImageOptions(ImageFormat.JPEG)

# Retrieve the image as a stream
stream = image_area.get_image_stream(options)

# Or save the image directly to a file
image_area.save("output.jpg", options)

See Also