PdfViewer.GetPageSize(Int32) Method

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

Namespace: DevExpress.XtraPdfViewer

Assembly: DevExpress.XtraPdfViewer.v20.2.dll

Declaration

public SizeF GetPageSize(
    int pageNumber
)
Public Function GetPageSize(
    pageNumber As Integer
) As SizeF

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