Skip to main content
A newer version of this page is available. .

PdfViewer.GetPageSize(Int32) Method

Returns the size (in inches) of the specified document page.

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v19.1.dll

Declaration

public SizeF GetPageSize(
    int pageNumber
)

Parameters

Name Type Description
pageNumber Int32

An integer value, specifying the document page index.

Returns

Type Description
SizeF

A SizeF structure, specifying the page width and height in inches.

Remarks

The code sample below calculates the zoom factor depending on the page height:

SizeF currentPageSize = pdfViewer1.GetPageSize(pdfViewer1.CurrentPageNumber);
float dpi = 110f;
float pageHeightPixel = currentPageSize.Height * dpi;
float topBottomOffset = 40f;
pdfViewer1.ZoomFactor = ((float)pdfViewer1.ClientSize.Height - topBottomOffset) / pageHeightPixel * 100f;
See Also