Back to Devexpress

WorkbookLayoutOptions.Dpi Property

officefileapi-devexpress-dot-xtraspreadsheet-dot-workbooklayoutoptions.md

latest3.1 KB
Original Source

WorkbookLayoutOptions.Dpi Property

Returns or specifies the resolution for document layout generation.

Namespace : DevExpress.XtraSpreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public float Dpi { get; set; }
vb
Public Property Dpi As Single

Property Value

TypeDescription
Single

A DPI value between 96 and 480.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Dpi
WorkbookOptions

.Layout .Dpi

|

Remarks

The Spreadsheet Document API uses the current screen DPI value to calculate document layout. This means that documents and printouts generated on systems with different screen DPI can be different (row heights and column widths can vary). On printed pages, these slight variations can push the last rows or columns to the next page (see the image below).

You can use the Dpi property to specify a custom DPI value. This option allows you to generate identical documents and printouts on machines with different screen DPIs.

Note

The Dpi setting is only available when you use the new layout calculation engine (the SpreadsheetCompatibilityOptions.EnableLegacyLayoutEngine property is false ).

csharp
Workbook workbook = new Workbook();
// Use 96 DPI to generate a workbook layout.
workbook.Options.Layout.Dpi = 96;
vb
Dim workbook As New Workbook()
' Use 96 DPI to generate a workbook layout.
workbook.Options.Layout.Dpi = 96

The WorkbookLayoutOptions.DefaultDpi property indicates whether a custom or default (screen) DPI value is used to generate a document layout. Call the WorkbookLayoutOptions.ResetDpi method to use the screen DPI for layout generation.

See Also

DefaultDpi

ResetDpi()

WorkbookLayoutOptions Class

WorkbookLayoutOptions Members

DevExpress.XtraSpreadsheet Namespace