How can I help you?
PdfDestination
6 Feb 20263 minutes to read
PdfDestination class represents the PDF destination.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Access the annotation at index 0
let annotation: PdfDocumentLinkAnnotation = document.getPage(0).annotations.at(0) as PdfDocumentLinkAnnotation;
// Initializes a new instance of the `PdfDestination` class.
let destination: PdfDestination = new PdfDestination();
// Sets the zoom factor.
destination.zoom = 20;
// Sets the page where the destination is situated.
destination.page = page;
// Sets the mode of the destination.
destination.mode = PdfDestinationMode.fitToPage;
// Sets the location of the destination.
destination.location = {x: 20, y: 20};
// Sets the bounds of the destination.
destination.destinationBounds = {x: 20, y: 20, width: 100, height: 50};
// Sets destination to document link annotation.
annotation.destination = destination;
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();Properties
Get destinationBounds Rectangle
Gets the bounds of the destination.
Set destinationBounds void
Sets the bounds of the destination.
| Parameter | Type | Description |
|---|---|---|
| value | Rectangle |
Bounds. |
Get isValid boolean
Gets a value indicating whether this instance is valid (Read only).
Get location Point
Gets the location of the destination.
Set location void
Sets the location of the destination.
| Parameter | Type | Description |
|---|---|---|
| value | Point |
Page. |
Get mode PdfDestinationMode
Gets the mode of the destination.
Set mode void
Sets the mode of the destination.
| Parameter | Type | Description |
|---|---|---|
| value | PdfDestinationMode |
Page. |
Get page PdfPage
Gets the page where the destination is situated.
Set page void
Sets the page where the destination is situated.
| Parameter | Type | Description |
|---|---|---|
| value | PdfPage |
Page. |
Get pageIndex number
Gets the page index of bookmark destination (Read only).
Get zoom number
Gets the zoom factor.
Set zoom void
Sets the zoom factor.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Zoom. |