ImageSavingArgs class

ImageSavingArgs class

Provides data for the IImageSavingCallback.imageSaving() event. To learn more, visit the Save a Document documentation article.

Remarks

By default, when Aspose.Words saves a document to HTML, it saves each image into a separate file. Aspose.Words uses the document file name and a unique number to generate unique file name for each image found in the document.

ImageSavingArgs allows to redefine how image file names are generated or to completely circumvent saving of images into files by providing your own stream objects.

To apply your own logic for generating image file names use the ImageSavingArgs.imageFileName, ImageSavingArgs.currentShape and ImageSavingArgs.isImageAvailable properties.

To save images into streams instead of files, use the Aspose.Words.Saving.ImageSavingArgs.ImageStream property.

Properties

NameDescription
currentShapeGets the ShapeBase object corresponding to the shape or group shape that is about to be saved.
documentGets the document object that is currently being saved.
imageFileNameGets or sets the file name (without path) where the image will be saved to.
isImageAvailableReturns true if the current image is available for export.
keepImageStreamOpenSpecifies whether Aspose.Words should keep the stream open or close it after saving an image.

See Also