current_shape property

ImageSavingArgs.current_shape property

Gets the ShapeBase object corresponding to the shape or group shape that is about to be saved.

@property
def current_shape(self) -> aspose.words.drawing.ShapeBase:
    ...

Remarks

IImageSavingCallback can be fired while saving either a shape or a group shape. That’s why the property has ShapeBase type. You can check whether it’s a group shape comparing ShapeBase.shape_type with ShapeType.GROUP or by casting it to one of derived classes: Shape or GroupShape.

Aspose.Words uses the document file name and a unique number to generate unique file name for each image found in the document. You can use the ImageSavingArgs.current_shape property to generate a “better” file name by examining shape properties such as ImageData.title (Shape only), ImageData.source_full_name (Shape only) and ShapeBase.name. Of course you can build file names using any other properties or criteria but note that subsidiary file names must be unique within the export operation.

Some images in the document can be unavailable. To check image availability use the ImageSavingArgs.is_image_available property.

See Also