Class XpsSaveOptions

XpsSaveOptions class

Represents the additional options when saving the file as the Xps.

public class XpsSaveOptions : PaginatedSaveOptions

Constructors

NameDescription
XpsSaveOptions()Creates options for saving xps file.
XpsSaveOptions(SaveFormat)(Obsolete.) Creates options for saving xps file.

Properties

NameDescription
AllColumnsInOnePagePerSheet { get; set; }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.(Inherited from PaginatedSaveOptions.)
CachedFileFolder { get; set; }The cached file folder is used to store some large data.(Inherited from SaveOptions.)
CheckFontCompatibility { get; set; }Indicates whether to check font compatibility for every character in text.(Inherited from PaginatedSaveOptions.)
CheckWorkbookDefaultFont { get; set; }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.(Inherited from PaginatedSaveOptions.)
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.)
DefaultEditLanguage { get; set; }Gets or sets default edit language.(Inherited from PaginatedSaveOptions.)
DefaultFont { get; set; }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.(Inherited from PaginatedSaveOptions.)
DrawObjectEventHandler { get; set; }Implements this interface to get DrawObject and Bound when rendering.(Inherited from PaginatedSaveOptions.)
EmfRenderSetting { get; set; }Setting for rendering Emf metafile.(Inherited from PaginatedSaveOptions.)
EncryptDocumentProperties { get; set; }Indicates whether encrypt document properties when saving as .xls file. The default value is true.(Inherited from SaveOptions.)
GridlineType { get; set; }Gets or sets gridline type.(Inherited from PaginatedSaveOptions.)
IgnoreError { get; set; }Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.(Inherited from PaginatedSaveOptions.)
IsFontSubstitutionCharGranularity { get; set; }Indicates whether to only substitute the font of character when the cell font is not compatibility for it.(Inherited from PaginatedSaveOptions.)
MergeAreas { get; set; }Indicates whether merge the areas of conditional formatting and validation before saving the file.(Inherited from SaveOptions.)
OnePagePerSheet { get; set; }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.(Inherited from PaginatedSaveOptions.)
OutputBlankPageWhenNothingToPrint { get; set; }Indicates whether to output a blank page when there is nothing to print.(Inherited from PaginatedSaveOptions.)
PageCount { get; set; }Gets or sets the number of pages to save.(Inherited from PaginatedSaveOptions.)
PageIndex { get; set; }Gets or sets the 0-based index of the first page to save.(Inherited from PaginatedSaveOptions.)
PageSavingCallback { get; set; }Control/Indicate progress of page saving process.(Inherited from PaginatedSaveOptions.)
PrintingPageType { get; set; }Indicates which pages will not be printed.(Inherited from PaginatedSaveOptions.)
RefreshChartCache { get; set; }Indicates whether refreshing chart cache data(Inherited from SaveOptions.)
SaveFormat { get; }Gets the save file format.(Inherited from SaveOptions.)
SheetSet { get; set; }Gets or sets the sheets to render. Default is all visible sheets in the workbook: Visible.(Inherited from PaginatedSaveOptions.)
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.)
TextCrossType { get; set; }Gets or sets displaying text type when the text width is larger than cell width.(Inherited from PaginatedSaveOptions.)
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

[C#]

using Aspose.Cells;
using Aspose.Cells.Rendering;
using System;

namespace Demos
{
    public class XpsSaveOptionsDemo
    {
        public static void XpsSaveOptionsExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet sheet = workbook.Worksheets[0];

            // Add some data to the worksheet
            sheet.Cells["A1"].PutValue("Hello");
            sheet.Cells["A2"].PutValue("World");
            sheet.Cells["A3"].PutValue(123);

            // Create XpsSaveOptions with specific settings
            XpsSaveOptions saveOptions = new XpsSaveOptions
            {
                DefaultFont = "Arial",
                CheckWorkbookDefaultFont = true,
                CheckFontCompatibility = true,
                IsFontSubstitutionCharGranularity = true,
                OnePagePerSheet = true,
                AllColumnsInOnePagePerSheet = true,
                IgnoreError = false,
                OutputBlankPageWhenNothingToPrint = false,
                PageIndex = 0,
                PageCount = 1,
                PrintingPageType = PrintingPageType.Default,
                GridlineType = GridlineType.Dotted,
                TextCrossType = TextCrossType.Default,
                DefaultEditLanguage = DefaultEditLanguage.English,
                SheetSet = SheetSet.All
            };

            // Save the workbook as XPS with the specified options
            workbook.Save("XpsSaveOptionsExample.xps", saveOptions);
        }
    }
}

See Also