Class ImageSaveOptions

ImageSaveOptions class

Represents image save options. For advanced usage, please use WorkbookRender or SheetRender.

public class ImageSaveOptions : SaveOptions

Constructors

NameDescription
ImageSaveOptions()Creates the options for saving image file.
ImageSaveOptions(SaveFormat)Creates the options for saving image file.

Properties

NameDescription
CachedFileFolder { get; set; }The cached file folder is used to store some large data.(Inherited from SaveOptions.)
CheckExcelRestriction { get; set; }Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K, it will be truncated.(Inherited from SaveOptions.)
ClearData { get; set; }Make the workbook empty after saving the file.(Inherited from SaveOptions.)
CreateDirectory { get; set; }If true and the directory does not exist, the directory will be automatically created before saving the file.(Inherited from SaveOptions.)
EncryptDocumentProperties { get; set; }Indicates whether encrypt document properties when saving as .xls file. The default value is true.(Inherited from SaveOptions.)
ImageOrPrintOptions { get; }Additional image creation options.
MergeAreas { get; set; }Indicates whether merge the areas of conditional formatting and validation before saving the file.(Inherited from SaveOptions.)
RefreshChartCache { get; set; }Indicates whether refreshing chart cache data(Inherited from SaveOptions.)
SaveFormat { get; }Gets the save file format.(Inherited from SaveOptions.)
SortExternalNames { get; set; }Indicates whether sorting external defined names before saving file.(Inherited from SaveOptions.)
SortNames { get; set; }Indicates whether sorting defined names before saving file.(Inherited from SaveOptions.)
StreamProvider { get; set; }Gets or sets the IStreamProvider for exporting objects.
UpdateSmartArt { get; set; }Indicates whether updating smart art setting. The default value is false.(Inherited from SaveOptions.)
ValidateMergedAreas { get; set; }Indicates whether validate merged cells before saving the file.(Inherited from SaveOptions.)
WarningCallback { get; set; }Gets or sets warning callback.(Inherited from SaveOptions.)

Examples

// Called: ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.Bmp);
public void Type_ImageSaveOptions()
        {
            Workbook workbook = new Workbook(Constants.sourcePath + "CELLSNET49614.xlsx");
            ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.Bmp);
           // saveOptions.StreamProvider = new StreamProvider();
            using (FileStream fs = File.Create(Constants.destPath + "CELLSNET49614_2.bmp"))
            {
                workbook.Save(fs, saveOptions);
            }
            Assert.AreEqual(FileFormatType.Bmp, FileFormatUtil.DetectFileFormat(Constants.destPath + "CELLSNET49614_2.bmp").FileFormatType);

        }

See Also