PdfBookmark.Destination Property
Gets or sets a destination with which a bookmark is associated.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v24.2.Core.dll
NuGet Package: DevExpress.Pdf.Core
#Declaration
public PdfDestination Destination { get; set; }
#Property Value
Type | Description |
---|---|
Pdf |
A destination. |
#Remarks
A destination includes the following view parameters:
- The displayed document page
- The location of the document window on this page
- The magnification (zoom factor)
Call one of the following methods to create a destination:
View Parameters | Methods |
---|---|
Fit the page’s bounding box to the document window both horizontally and vertically. | Pdf |
Fit the page’s bounding box to the document window horizontally. | Pdf |
Fit the page’s bounding box to the document window vertically. | Pdf |
Fit the entire page to the document window both horizontally and vertically (Zoom to Page Level view). | Pdf |
Fit the entire page to the document window horizontally. | Pdf |
Fit the entire page to the document window vertically. | Pdf |
Display the specified page area in the document window. | Pdf |
Position the specified page coordinate at the top left document window corner, and specify the zoom factor. | Pdf |
#Example
The code sample below creates a bookmark with a destination that displays the eighth page as follows:
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
// Load a document
pdfDocumentProcessor.LoadDocument("Demo.pdf");
// Create a FitB destination that refers to the eighth page
PdfFitBBoxDestination destination =
new PdfFitBBoxDestination(pdfDocumentProcessor.Document.Pages[7]);
// Create a bookmark
PdfBookmark bookmark = new PdfBookmark();
bookmark.Title = "Annotations";
// Associate the bookmark with the created destination
bookmark.Destination = destination;
// Add the bookmark to the document collection
pdfDocumentProcessor.Document.Bookmarks.Add(bookmark);
// Save the result
pdfDocumentProcessor.SaveDocument("out.pdf");
}