save method

save

Saves the image data to the underlying stream.

def save(self):
    ...

Example

Saves all changes made to drawing. Note: Only DXF is currently supported

save

Saves the object’s data to the specified stream.

def save(self, stream):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream to save the object’s data to.

save

Saves the object’s data to the specified file location.

def save(self, file_path):
    ...
ParameterTypeDescription
file_pathstrThe file path to save the object’s data to.

save

Saves the object’s data to the specified file location in the specified file format according to save options.

def save(self, file_path, options):
    ...
ParameterTypeDescription
file_pathstrThe file path.
optionsaspose.cad.imageoptions.ImageOptionsBaseThe options.

Example

Exports drawing to BMP with specified size

save

Saves the image’s data to the specified stream in the specified file format according to save options.

def save(self, stream, options_base):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe stream to save the image’s data to.
options_baseaspose.cad.imageoptions.ImageOptionsBaseThe save options.

Exceptions

ExceptionDescription
ArgumentNullExceptionoptionsBase
ArgumentExceptionCannot save to the specified format as it is not supported at the moment.;optionsBase
ImageSaveExceptionImage export failed.

Example

Exports drawing to JPEG format and rotate it by 90 degrees then writes to memory stream

save

Saves the object’s data to the specified file location.

def save(self, file_path, over_write):
    ...
ParameterTypeDescription
file_pathstrThe file path to save the object’s data to.
over_writeboolif set to true over write the file contents, otherwise append will occur.

See Also