PdfFieldActions
12 Sep 20251 minute to read
Represents actions to be performed as response to field events.
```typescript
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Access button field
let field: PdfButtonField = document.form.fieldAt(0) as PdfButtonField;
// Access the second page
let secondPage: PdfPage = document.getPage(2);
// Create a PdfDestination for the specified page
let destination: PdfDestination = new PdfDestination(secondPage)
// Create a new PdfGoToAction with the specified destination
let gotoAction: PdfGoToAction = new PdfGoToAction(destination);
// Get the pdf field actions
let fieldActions: PdfFieldActions = field.actions;
// Save the document
document.save(‘output.pdf’);
// Destroy the document
document.destroy();
Properties
gotFocus PdfAction
Get the action to be performed when the field receives the input focus.
lostFocus PdfAction
Get the action to be performed when the field loses the input focus.
mouseDown PdfAction
Get the action to be performed when the mouse button is pressed inside the field’s area.
mouseEnter PdfAction
Get the action to be performed when the mouse cursor enters the field area.
mouseLeave PdfAction
Get the action to be performed when the cursor exits the fields area.
mouseUp PdfAction
Get the action to be performed when the mouse button is released inside the field area.