Back to Devexpress

WorksheetPrintOptions.FitToPage Property

officefileapi-devexpress-dot-spreadsheet-dot-worksheetprintoptions.md

latest2.8 KB
Original Source

WorksheetPrintOptions.FitToPage Property

Indicates whether the worksheet content is scaled to fit to a specific number of pages.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool FitToPage { get; set; }
vb
Property FitToPage As Boolean

Property Value

TypeDescription
Boolean

true , if the FitToPage print option is enabled; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to FitToPage
Worksheet

.PrintOptions .FitToPage

|

Remarks

To scale the content to fit to a specific number of pages, set the FitToPage property to true and specify the desired number of pages by width (WorksheetPrintOptions.FitToWidth property) or by height (the WorksheetPrintOptions.FitToHeight property).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FitToPage property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-create-loan-amortization-schedule-within-blazor-server-app/CS/BlazorAppSpreadsheet/Code/DocumentGenerator.cs#L201

csharp
Sheet.SetPrintRange(Sheet.GetDataRange());
Sheet.PrintOptions.FitToPage = true;
Sheet.PrintOptions.FitToWidth = 1;

See Also

WorksheetPrintOptions Interface

WorksheetPrintOptions Members

DevExpress.Spreadsheet Namespace