Pdf - PdfRemoteGoToAction
18 Nov 20266 minutes to read
Represents an action that navigates to a destination in a remote 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 = 2;
destination.mode = PdfDestinationMode.fitToPage;
// Create a remote GoTo action
let action: PdfRemoteGoToAction = new PdfRemoteGoToAction('input.pdf', destination);
action.isNewWindow = true;
// 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 filePath string
Gets the path of the remote 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 PDF file path
let filePath: string = action.filePath;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set filePath void
Sets the path of the remote 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 PDF file path
action.filePath = 'updated.pdf';
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | string |
The path of the remote PDF document. |
Get isNewWindow boolean
Gets whether the remote PDF document opens in a new window.
// 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 new-window setting
let isNewWindow: boolean = action.isNewWindow;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set isNewWindow void
Sets whether the remote PDF document opens in a new window.
// 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;
// Open the remote PDF in a new window
action.isNewWindow = true;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | boolean |
true to open the remote PDF in a new window; otherwise, false. |
Get next PdfAction
Get the next action to be performed after the action represented by this instance.
Set next void
Set the next action to be performed after the action represented by this instance.
| Parameter | Type | Description |
|---|---|---|
| value | PdfAction |
The next action to be executed. |
Get remoteDestination PdfRemoteDestination
Gets the destination in the remote 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
let destination: PdfRemoteDestination = action.remoteDestination;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set remoteDestination void
Sets the destination in the remote 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;
// Create and set a remote destination
let destination: PdfRemoteDestination = new PdfRemoteDestination();
destination.pageNumber = 1;
destination.mode = PdfDestinationMode.fitToPage;
action.remoteDestination = destination;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | PdfRemoteDestination |
The destination in the remote PDF document. |