PdfViewer.GetPageInfo(Int32) Method
Obtains information (crop box and rotation angle) about a specific page.
Namespace: DevExpress.XtraPdfViewer
Assembly: DevExpress.XtraPdfViewer.v24.2.dll
NuGet Package: DevExpress.Win.PdfViewer
#Declaration
public PdfPageInfo GetPageInfo(
int pageNumber
)
#Parameters
Name | Type | Description |
---|---|---|
page |
Int32 | The page number for which information should be obtained. |
#Returns
Type | Description |
---|---|
Pdf |
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:
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));
pdfViewer.AddStickyNote(stickyNotePosition, "Note", Color.Yellow);
Tip
Refer to the following example for a code snippet on how to add a sticky note to the page corner regardless of the page’s rotation angle:
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetPageInfo(Int32) method.
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.