Class SheetPrintingPreview
Class SheetPrintingPreview
Namespace: Aspose.Cells.Rendering
Assembly: Aspose.Cells.dll (25.2.0)
Worksheet printing preview.
public class SheetPrintingPreview
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
SheetPrintingPreview(Worksheet, ImageOrPrintOptions)
The construct of SheetPrintingPreview
public SheetPrintingPreview(Worksheet sheet, ImageOrPrintOptions options)
Parameters
sheet
Worksheet
Indicate which spreadsheet to be printed.
options
ImageOrPrintOptions
ImageOrPrintOptions contains some property of output
Properties
EvaluatedPageCount
Evaluate the total page count of this worksheet
public int EvaluatedPageCount { get; }
Property Value
Examples
The following code shows the fastest way to get page count of a worksheet.
csharp
Workbook workbook = new Workbook("Book1.xlsx");
SheetPrintingPreview sheetPrintingPreview = new SheetPrintingPreview(workbook.Worksheets[0], new ImageOrPrintOptions());
//fastest way to get page count especailly when there are massive data in worksheet.
Console.WriteLine(sheetPrintingPreview.EvaluatedPageCount);