Pdf - PdfRemoteDestination
18 Nov 20264 minutes to read
Represents a destination in a remote or embedded PDF document.
// Create a new PDF document
let document: PdfDocument = new PdfDocument();
let page: PdfPage = document.addPage();
// Create a remote destination
let destination: PdfRemoteDestination = new PdfRemoteDestination();
destination.pageNumber = 1;
destination.mode = PdfDestinationMode.fitToPage;
// Create a remote GoTo action
let action: PdfRemoteGoToAction = new PdfRemoteGoToAction('input.pdf', destination);
// Create a button and assign the action
let field: PdfButtonField = new PdfButtonField(
page, 'RemoteGoTo', { x: 20, y: 20, width: 120, height: 30 }
);
field.text = 'Open remote PDF';
field.actions.mouseUp = action;
document.form.add(field);
// Save and destroy the document
document.save('output.pdf');
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 pageNumber number
Gets the zero-based page number in the target PDF document.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the remote GoTo button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the remote GoTo action
let action: PdfRemoteGoToAction = field.actions.mouseUp as PdfRemoteGoToAction;
// Get the remote destination page number
let pageNumber: number = action.remoteDestination.pageNumber;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set pageNumber void
Sets the zero-based page number in the target PDF document.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the remote GoTo button
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Get the remote GoTo action
let action: PdfRemoteGoToAction = field.actions.mouseUp as PdfRemoteGoToAction;
// Set the remote destination page number
action.remoteDestination.pageNumber = 2;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | number |
The zero-based page number in the target PDF document. |
Get zoom number
Gets the zoom factor.
Set zoom void
Sets the zoom factor.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Zoom. |