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

PdfViewerControl.GetPageInfo(Int32) Method

Obtains information (crop box and rotation angle) about a specific page.

Namespace: DevExpress.Xpf.PdfViewer

Assembly: DevExpress.Xpf.PdfViewer.v24.2.dll

NuGet Package: DevExpress.Wpf.PdfViewer

#Declaration

public PdfPageInfo GetPageInfo(
    int pageNumber
)

#Parameters

Name Type Description
pageNumber Int32

The page number for which information should be obtained.

#Returns

Type Description
PdfPageInfo

An object that contains page information (crop box and rotation angle).

#Remarks

Use the GetPageInfo method to retrieve page information and calculate coordinates correctly. The code sample below shows how to use the retrieved information to insert a sticky note at the first page’s top right corner:

private void pdfViewer_DocumentLoaded(object sender, System.Windows.RoutedEventArgs e)
{
    var pageInfo = pdfViewer.GetPageInfo(1);
    var cropBox = pageInfo.CropBox;

    PdfPoint stickyNotePoint = new PdfPoint(cropBox.Right - 20, cropBox.Top - 20);

    var points = new[] { new PointF((float)stickyNotePoint.X, (float)stickyNotePoint.Y) };

    PdfDocumentPosition stickyNotePosition = new PdfDocumentPosition(1, new PdfPoint(points[0].X, points[0].Y));
    var stickyNoteColor = System.Windows.Media.Color.FromRgb(214, 222, 4);
    pdfViewer.AddStickyNote(stickyNotePosition, "Note", stickyNoteColor);
}
See Also