Pdf - PdfPageActions
18 Nov 20263 minutes to read
Represents actions associated with page events in a PDF document.
// Create a new PDF document
let document: PdfDocument = new PdfDocument();
let page: PdfPage = document.addPage();
// Create a JavaScript action
let action: PdfJavaScriptAction = new PdfJavaScriptAction('app.alert("Page opened");');
// Assign the action to the page open event
page.actions.open = action;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Properties
Get close PdfAction
Gets the action executed when the page is closed.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the first page
let page: PdfPage = document.getPage(0);
// Get the action assigned to the page close event
let action: PdfAction = page.actions.close;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set close void
Sets the action executed when the page is closed.
// Create a new PDF document
let document: PdfDocument = new PdfDocument();
let page: PdfPage = document.addPage();
// Create a JavaScript action
let action: PdfJavaScriptAction = new PdfJavaScriptAction('app.alert("Page closed");');
// Assign the action to the page close event
page.actions.close = action;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | PdfAction |
The action to execute when the page is closed. |
Get open PdfAction
Gets the action executed when the page is opened.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the first page
let page: PdfPage = document.getPage(0);
// Get the action assigned to the page open event
let action: PdfAction = page.actions.open;
// Save and destroy the document
document.save('output.pdf');
document.destroy();Set open void
Sets the action executed when the page is opened.
// Create a new PDF document
let document: PdfDocument = new PdfDocument();
let page: PdfPage = document.addPage();
// Create a JavaScript action
let action: PdfJavaScriptAction = new PdfJavaScriptAction('app.alert("Page opened");');
// Assign the action to the page open event
page.actions.open = action;
// Save and destroy the document
document.save('output.pdf');
document.destroy();| Parameter | Type | Description |
|---|---|---|
| value | PdfAction |
The action to execute when the page is opened. |