Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WorkbookLayoutOptions.Dpi Property

Returns or specifies the resolution for document layout generation.

Namespace: DevExpress.XtraSpreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public float Dpi { get; set; }

#Property Value

Type Description
Single

A DPI value between 96 and 480.

#Property Paths

You can access this nested property as listed below:

Object Type Path 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).

Different DPI settings

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).

Workbook workbook = 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