Class PaginatedSaveOptions

Class PaginatedSaveOptions

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Represents the options for pagination.

public abstract class PaginatedSaveOptions : SaveOptions

Inheritance

objectSaveOptionsPaginatedSaveOptions

Derived

DocxSaveOptions, PclSaveOptions, PdfSaveOptions, PptxSaveOptions, XpsSaveOptions

Inherited Members

SaveOptions.m_SaveFormat, SaveOptions.SaveFormat, SaveOptions.ClearData, SaveOptions.CachedFileFolder, SaveOptions.ValidateMergedAreas, SaveOptions.MergeAreas, SaveOptions.CreateDirectory, SaveOptions.SortNames, SaveOptions.SortExternalNames, SaveOptions.RefreshChartCache, SaveOptions.WarningCallback, SaveOptions.CheckExcelRestriction, SaveOptions.UpdateSmartArt, SaveOptions.EncryptDocumentProperties, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

PaginatedSaveOptions()

protected PaginatedSaveOptions()

Properties

AllColumnsInOnePagePerSheet

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.

public bool AllColumnsInOnePagePerSheet { get; set; }

Property Value

bool

CheckFontCompatibility

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

public bool CheckFontCompatibility { get; set; }

Property Value

bool

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;

CheckWorkbookDefaultFont

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.

public bool CheckWorkbookDefaultFont { get; set; }

Property Value

bool

Remarks

Default is true.

DefaultEditLanguage

Gets or sets default edit language.

public DefaultEditLanguage DefaultEditLanguage { get; set; }

Property Value

DefaultEditLanguage

Remarks

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

DefaultFont

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.

public string DefaultFont { get; set; }

Property Value

string

DrawObjectEventHandler

Implements this interface to get DrawObject and Bound when rendering.

public DrawObjectEventHandler DrawObjectEventHandler { get; set; }

Property Value

DrawObjectEventHandler

EmfRenderSetting

Setting for rendering Emf metafile.

public EmfRenderSetting EmfRenderSetting { get; set; }

Property Value

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.

GridlineType

Gets or sets gridline type.

public GridlineType GridlineType { get; set; }

Property Value

GridlineType

Remarks

Default is Dotted type.

IgnoreError

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

public bool IgnoreError { get; set; }

Property Value

bool

IsFontSubstitutionCharGranularity

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

public bool IsFontSubstitutionCharGranularity { get; set; }

Property Value

bool

Remarks

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

OnePagePerSheet

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.

public bool OnePagePerSheet { get; set; }

Property Value

bool

OutputBlankPageWhenNothingToPrint

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

public bool OutputBlankPageWhenNothingToPrint { get; set; }

Property Value

bool

Remarks

Default is true.

PageCount

Gets or sets the number of pages to save.

public int PageCount { get; set; }

Property Value

int

Examples

The following example shows how to render a range of pages (3 and 4) in a Microsoft Excel file to PDF.

csharp
//Open an Excel file
Workbook wb = new Workbook("Book1.xlsx");

PdfSaveOptions options = new PdfSaveOptions();

//Print only Page 3 and Page 4 in the output PDF
//Starting page index (0-based index)
options.PageIndex = 3;
//Number of pages to be printed
options.PageCount = 2;

//Save the PDF file
wb.Save("output.pdf", options);

Remarks

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

PageIndex

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

public int PageIndex { get; set; }

Property Value

int

Examples

The following example shows how to render a range of pages (3 and 4) in a Microsoft Excel file to PDF.

csharp
//Open an Excel file
Workbook wb = new Workbook("Book1.xlsx");

PdfSaveOptions options = new PdfSaveOptions();

//Print only Page 3 and Page 4 in the output PDF
//Starting page index (0-based index)
options.PageIndex = 3;
//Number of pages to be printed
options.PageCount = 2;

//Save the PDF file
wb.Save("output.pdf", options);

Remarks

Default is 0.

PageSavingCallback

Control/Indicate progress of page saving process.

public IPageSavingCallback PageSavingCallback { get; set; }

Property Value

IPageSavingCallback

PrintingPageType

Indicates which pages will not be printed.

public PrintingPageType PrintingPageType { get; set; }

Property Value

PrintingPageType

Examples

The following code omits blank pages or pages which only contains some style content like cell background, borders.

csharp
Workbook wb = new Workbook("Book1.xlsx");

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

//ignore blank pages
pdfSaveOptions.PrintingPageType = PrintingPageType.IgnoreBlank;

wb.Save("output_ignore_blank_page.pdf", pdfSaveOptions);


//ignore blank pages and pages which only contains some style content like cell background
pdfSaveOptions.PrintingPageType = PrintingPageType.IgnoreStyle;

wb.Save("output_ignore_blank_and_style_page.pdf", pdfSaveOptions);

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.

SheetSet

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

public SheetSet SheetSet { get; set; }

Property Value

SheetSet

Examples

The following code only renders active sheet to pdf.

csharp
Workbook workbook = new Workbook("Book1.xlsx");

int activeSheetIndex = workbook.Worksheets.ActiveSheetIndex;

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
//set active sheet index to sheet set.
pdfSaveOptions.SheetSet = new SheetSet(new int[] { activeSheetIndex });
workbook.Save("output.pdf", pdfSaveOptions);

TextCrossType

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

public TextCrossType TextCrossType { get; set; }

Property Value

TextCrossType