DocxSaveOptions

DocxSaveOptions class

Represents options of saving .docx file.

class DocxSaveOptions extends PaginatedSaveOptions;

Constructors

NameDescription
constructor()Represents options of saving .docx file.
constructor(PaginatedSaveOptions)Constructs from a parent object convertible to this.
constructor(boolean)Represents options of saving .docx file.

Methods

MethodDescription
isNull()Checks whether the implementation object is null.
getSaveFormat()Gets the save file format.
getClearData()Make the workbook empty after saving the file.
setClearData(boolean)Make the workbook empty after saving the file.
getCachedFileFolder()The cached file folder is used to store some large data.
setCachedFileFolder(string)The cached file folder is used to store some large data.
getValidateMergedAreas()Indicates whether validate merged cells before saving the file.
setValidateMergedAreas(boolean)Indicates whether validate merged cells before saving the file.
getMergeAreas()Indicates whether merge the areas of conditional formatting and validation before saving the file.
setMergeAreas(boolean)Indicates whether merge the areas of conditional formatting and validation before saving the file.
getCreateDirectory()If true and the directory does not exist, the directory will be automatically created before saving the file.
setCreateDirectory(boolean)If true and the directory does not exist, the directory will be automatically created before saving the file.
getSortNames()Indicates whether sorting defined names before saving file.
setSortNames(boolean)Indicates whether sorting defined names before saving file.
getSortExternalNames()Indicates whether sorting external defined names before saving file.
setSortExternalNames(boolean)Indicates whether sorting external defined names before saving file.
getRefreshChartCache()Indicates whether refreshing chart cache data
setRefreshChartCache(boolean)Indicates whether refreshing chart cache data
setWarningCallback(IWarningCallback)Gets or sets warning callback.
getWarningCallback()Gets or sets warning callback.
getUpdateSmartArt()Indicates whether updating smart art setting. The default value is false.
setUpdateSmartArt(boolean)Indicates whether updating smart art setting. The default value is false.
getEncryptDocumentProperties()Indicates whether encrypt document properties when saving as .xls file. The default value is true.
setEncryptDocumentProperties(boolean)Indicates whether encrypt document properties when saving as .xls file. The default value is true.
getDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.
setDefaultFont(string)When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.
getCheckWorkbookDefaultFont()When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.
setCheckWorkbookDefaultFont(boolean)When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.
setCheckFontCompatibility(boolean)Indicates whether to check font compatibility for every character in text.
getCheckFontCompatibility()Indicates whether to check font compatibility for every character in text.
setIsFontSubstitutionCharGranularity(boolean)Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
isFontSubstitutionCharGranularity()Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
getOnePagePerSheet()If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
setOnePagePerSheet(boolean)If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
getAllColumnsInOnePagePerSheet()If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.
setAllColumnsInOnePagePerSheet(boolean)If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.
getIgnoreError()Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.
setIgnoreError(boolean)Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.
getOutputBlankPageWhenNothingToPrint()Indicates whether to output a blank page when there is nothing to print.
setOutputBlankPageWhenNothingToPrint(boolean)Indicates whether to output a blank page when there is nothing to print.
setPageIndex(number)Gets or sets the 0-based index of the first page to save.
getPageIndex()Gets or sets the 0-based index of the first page to save.
setPageCount(number)Gets or sets the number of pages to save.
getPageCount()Gets or sets the number of pages to save.
getPrintingPageType()Indicates which pages will not be printed.
setPrintingPageType(PrintingPageType)Indicates which pages will not be printed.
getGridlineType()Gets or sets gridline type.
setGridlineType(GridlineType)Gets or sets gridline type.
getTextCrossType()Gets or sets displaying text type when the text width is larger than cell width.
setTextCrossType(TextCrossType)Gets or sets displaying text type when the text width is larger than cell width.
getDefaultEditLanguage()Gets or sets default edit language.
setDefaultEditLanguage(DefaultEditLanguage)Gets or sets default edit language.
getSheetSet()Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.
setSheetSet(SheetSet)Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.
getDrawObjectEventHandler()Implements this interface to get DrawObject and Bound when rendering.
setDrawObjectEventHandler(DrawObjectEventHandler)Implements this interface to get DrawObject and Bound when rendering.
getPageSavingCallback()Control/Indicate progress of page saving process.
setPageSavingCallback(IPageSavingCallback)Control/Indicate progress of page saving process.
getEmfRenderSetting()Setting for rendering Emf metafile.
setEmfRenderSetting(EmfRenderSetting)Setting for rendering Emf metafile.

constructor()

Represents options of saving .docx file.

constructor();

constructor(PaginatedSaveOptions)

Constructs from a parent object convertible to this.

constructor(obj: PaginatedSaveOptions);

Parameters:

ParameterTypeDescription
objPaginatedSaveOptionsThe parent object.

constructor(boolean)

Represents options of saving .docx file.

constructor(saveAsImage: boolean);

Parameters:

ParameterTypeDescription
saveAsImagebooleanIf True, the workbook will be converted into some pictures of .docx file. ///If False, the workbook will be converted into some tables of .docx file.

isNull()

Checks whether the implementation object is null.

isNull() : boolean;

getSaveFormat()

Gets the save file format.

getSaveFormat() : SaveFormat;

Returns

SaveFormat

getClearData()

Make the workbook empty after saving the file.

getClearData() : boolean;

setClearData(boolean)

Make the workbook empty after saving the file.

setClearData(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getCachedFileFolder()

The cached file folder is used to store some large data.

getCachedFileFolder() : string;

setCachedFileFolder(string)

The cached file folder is used to store some large data.

setCachedFileFolder(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getValidateMergedAreas()

Indicates whether validate merged cells before saving the file.

getValidateMergedAreas() : boolean;

Remarks

The default value is false.

setValidateMergedAreas(boolean)

Indicates whether validate merged cells before saving the file.

setValidateMergedAreas(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getMergeAreas()

Indicates whether merge the areas of conditional formatting and validation before saving the file.

getMergeAreas() : boolean;

Remarks

The default value is false.

setMergeAreas(boolean)

Indicates whether merge the areas of conditional formatting and validation before saving the file.

setMergeAreas(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getCreateDirectory()

If true and the directory does not exist, the directory will be automatically created before saving the file.

getCreateDirectory() : boolean;

Remarks

The default value is false.

setCreateDirectory(boolean)

If true and the directory does not exist, the directory will be automatically created before saving the file.

setCreateDirectory(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is false.

getSortNames()

Indicates whether sorting defined names before saving file.

getSortNames() : boolean;

setSortNames(boolean)

Indicates whether sorting defined names before saving file.

setSortNames(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getSortExternalNames()

Indicates whether sorting external defined names before saving file.

getSortExternalNames() : boolean;

setSortExternalNames(boolean)

Indicates whether sorting external defined names before saving file.

setSortExternalNames(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getRefreshChartCache()

Indicates whether refreshing chart cache data

getRefreshChartCache() : boolean;

setRefreshChartCache(boolean)

Indicates whether refreshing chart cache data

setRefreshChartCache(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

setWarningCallback(IWarningCallback)

Gets or sets warning callback.

setWarningCallback(value: IWarningCallback) : void;

Parameters:

ParameterTypeDescription
valueIWarningCallbackThe value to set.

getWarningCallback()

Gets or sets warning callback.

getWarningCallback() : IWarningCallback;

Returns

IWarningCallback

getUpdateSmartArt()

Indicates whether updating smart art setting. The default value is false.

getUpdateSmartArt() : boolean;

Remarks

Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.

setUpdateSmartArt(boolean)

Indicates whether updating smart art setting. The default value is false.

setUpdateSmartArt(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.

getEncryptDocumentProperties()

Indicates whether encrypt document properties when saving as .xls file. The default value is true.

getEncryptDocumentProperties() : boolean;

Remarks

Only for .xls,xlsx,xlsb and xlsm file.

setEncryptDocumentProperties(boolean)

Indicates whether encrypt document properties when saving as .xls file. The default value is true.

setEncryptDocumentProperties(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Only for .xls,xlsx,xlsb and xlsm file.

getDefaultFont()

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.

getDefaultFont() : string;

setDefaultFont(string)

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.

setDefaultFont(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getCheckWorkbookDefaultFont()

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.

getCheckWorkbookDefaultFont() : boolean;

Remarks

Default is true.

setCheckWorkbookDefaultFont(boolean)

When characters in the Excel are Unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook’s default font to show these characters first.

setCheckWorkbookDefaultFont(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Default is true.

setCheckFontCompatibility(boolean)

Indicates whether to check font compatibility for every character in text.

setCheckFontCompatibility(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

The default value is true. Disable this property may give better performance. But when the default or specified font of text/character cannot be used to render it, unreadable characters(such as block) maybe occur in the generated pdf. For such situation user should keep this property as true so that alternative font can be searched and used to render the text instead;

getCheckFontCompatibility()

Indicates whether to check font compatibility for every character in text.

getCheckFontCompatibility() : boolean;

Remarks

The default value is true. Disable this property may give better performance. But when the default or specified font of text/character cannot be used to render it, unreadable characters(such as block) maybe occur in the generated pdf. For such situation user should keep this property as true so that alternative font can be searched and used to render the text instead;

setIsFontSubstitutionCharGranularity(boolean)

Indicates whether to only substitute the font of character when the cell font is not compatibility for it.

setIsFontSubstitutionCharGranularity(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

isFontSubstitutionCharGranularity()

Indicates whether to only substitute the font of character when the cell font is not compatibility for it.

isFontSubstitutionCharGranularity() : boolean;

Remarks

Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

getOnePagePerSheet()

If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.

getOnePagePerSheet() : boolean;

setOnePagePerSheet(boolean)

If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.

setOnePagePerSheet(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getAllColumnsInOnePagePerSheet()

If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.

getAllColumnsInOnePagePerSheet() : boolean;

setAllColumnsInOnePagePerSheet(boolean)

If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.

setAllColumnsInOnePagePerSheet(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getIgnoreError()

Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.

getIgnoreError() : boolean;

setIgnoreError(boolean)

Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.

setIgnoreError(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getOutputBlankPageWhenNothingToPrint()

Indicates whether to output a blank page when there is nothing to print.

getOutputBlankPageWhenNothingToPrint() : boolean;

Remarks

Default is true.

setOutputBlankPageWhenNothingToPrint(boolean)

Indicates whether to output a blank page when there is nothing to print.

setOutputBlankPageWhenNothingToPrint(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Default is true.

setPageIndex(number)

Gets or sets the 0-based index of the first page to save.

setPageIndex(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

Remarks

Default is 0.

getPageIndex()

Gets or sets the 0-based index of the first page to save.

getPageIndex() : number;

Remarks

Default is 0.

setPageCount(number)

Gets or sets the number of pages to save.

setPageCount(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

Remarks

Default is System.Int32.MaxValue which means all pages will be rendered..

getPageCount()

Gets or sets the number of pages to save.

getPageCount() : number;

Remarks

Default is System.Int32.MaxValue which means all pages will be rendered..

getPrintingPageType()

Indicates which pages will not be printed.

getPrintingPageType() : PrintingPageType;

Returns

PrintingPageType

Remarks

If content in the sheet is sparse, there will be some pages are totally blank in the output pdf file. If you don’t want these blank pages, you can use this option to omit them.

setPrintingPageType(PrintingPageType)

Indicates which pages will not be printed.

setPrintingPageType(value: PrintingPageType) : void;

Parameters:

ParameterTypeDescription
valuePrintingPageTypeThe value to set.

Remarks

If content in the sheet is sparse, there will be some pages are totally blank in the output pdf file. If you don’t want these blank pages, you can use this option to omit them.

getGridlineType()

Gets or sets gridline type.

getGridlineType() : GridlineType;

Returns

GridlineType

Remarks

Default is Dotted type.

setGridlineType(GridlineType)

Gets or sets gridline type.

setGridlineType(value: GridlineType) : void;

Parameters:

ParameterTypeDescription
valueGridlineTypeThe value to set.

Remarks

Default is Dotted type.

getTextCrossType()

Gets or sets displaying text type when the text width is larger than cell width.

getTextCrossType() : TextCrossType;

Returns

TextCrossType

setTextCrossType(TextCrossType)

Gets or sets displaying text type when the text width is larger than cell width.

setTextCrossType(value: TextCrossType) : void;

Parameters:

ParameterTypeDescription
valueTextCrossTypeThe value to set.

getDefaultEditLanguage()

Gets or sets default edit language.

getDefaultEditLanguage() : DefaultEditLanguage;

Returns

DefaultEditLanguage

Remarks

It may display/render different layouts for text paragraph when different edit languages is set. Default is Aspose.Cells.DefaultEditLanguage.Auto.

setDefaultEditLanguage(DefaultEditLanguage)

Gets or sets default edit language.

setDefaultEditLanguage(value: DefaultEditLanguage) : void;

Parameters:

ParameterTypeDescription
valueDefaultEditLanguageThe value to set.

Remarks

It may display/render different layouts for text paragraph when different edit languages is set. Default is Aspose.Cells.DefaultEditLanguage.Auto.

getSheetSet()

Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.

getSheetSet() : SheetSet;

Returns

SheetSet

setSheetSet(SheetSet)

Gets or sets the sheets to render. Default is all visible sheets in the workbook: Aspose.Cells.Rendering.SheetSet.Visible.

setSheetSet(value: SheetSet) : void;

Parameters:

ParameterTypeDescription
valueSheetSetThe value to set.

getDrawObjectEventHandler()

Implements this interface to get DrawObject and Bound when rendering.

getDrawObjectEventHandler() : DrawObjectEventHandler;

Returns

DrawObjectEventHandler

setDrawObjectEventHandler(DrawObjectEventHandler)

Implements this interface to get DrawObject and Bound when rendering.

setDrawObjectEventHandler(value: DrawObjectEventHandler) : void;

Parameters:

ParameterTypeDescription
valueDrawObjectEventHandlerThe value to set.

getPageSavingCallback()

Control/Indicate progress of page saving process.

getPageSavingCallback() : IPageSavingCallback;

Returns

IPageSavingCallback

setPageSavingCallback(IPageSavingCallback)

Control/Indicate progress of page saving process.

setPageSavingCallback(value: IPageSavingCallback) : void;

Parameters:

ParameterTypeDescription
valueIPageSavingCallbackThe value to set.

getEmfRenderSetting()

Setting for rendering Emf metafile.

getEmfRenderSetting() : EmfRenderSetting;

Returns

EmfRenderSetting

Remarks

EMF metafiles identified as “EMF+ Dual” can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When Aspose.Cells.EmfRenderSetting.EmfPlusPrefer is set, then EMF+ records will be parsed while rendering to page, otherwise only EMF records will be parsed. Default value is Aspose.Cells.EmfRenderSetting.EmfOnly.

setEmfRenderSetting(EmfRenderSetting)

Setting for rendering Emf metafile.

setEmfRenderSetting(value: EmfRenderSetting) : void;

Parameters:

ParameterTypeDescription
valueEmfRenderSettingThe value to set.

Remarks

EMF metafiles identified as “EMF+ Dual” can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When Aspose.Cells.EmfRenderSetting.EmfPlusPrefer is set, then EMF+ records will be parsed while rendering to page, otherwise only EMF records will be parsed. Default value is Aspose.Cells.EmfRenderSetting.EmfOnly.