Back to Devexpress

Document.AutoFitToPagesWidth Property

corelibraries-devexpress-dot-xtraprinting-dot-document-1eae764f.md

latest3.6 KB
Original Source

Document.AutoFitToPagesWidth Property

Specifies the number of virtual pages to fit into one physical page, so their total width is the same as the width of a physical page.

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public abstract int AutoFitToPagesWidth { get; set; }
vb
Public MustOverride Property AutoFitToPagesWidth As Integer

Property Value

TypeDescription
Int32

An integer value, specifying the number of pages.

|

Remarks

Use this property to scale a document to best fit a required number of virtual pages into one physical page by their width.

Use the Document.ScaleFactor property to specify a custom scale factor (measured in fractions of 1). In this case, the AutoFitToPagesWidth property must be set to 0.

Limitations

The AutoFitToPagesWidth property is ignored when the MultiColumn.Layout property is set to ColumnLayout.DownThenAcross.

The AutoFitToPagesWidth property has no effect for the TopMarginBand and BottomMarginBand because report margin bands do not scale.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoFitToPagesWidth 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.

asp-net-web-forms-grid-fit-exported-document-to-page/CS/WebApplication1/Default.aspx.cs#L21

csharp
pcl.CreateDocument(false);
pcl.PrintingSystemBase.Document.AutoFitToPagesWidth = 1;
pcl.ExportToPdf(ms);

asp-net-web-forms-grid-fit-exported-document-to-page/VB/WebApplication1/Default.aspx.vb#L22

vb
pcl.CreateDocument(False)
pcl.PrintingSystemBase.Document.AutoFitToPagesWidth = 1
pcl.ExportToPdf(ms)

See Also

ScaleFactor

How to: Stretch the Detail Area to Fill the Entire Page

Document Class

Document Members

DevExpress.XtraPrinting Namespace