Click or drag to resize
Pdf Library for .NET

PdfActionJavaScript Class

An action that runs a JavaScript script (for example, as the document open action so a viewer executes the script when the document is opened).
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfAction
    SelectPdf.UniversalPdfActionJavaScript

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfActionJavaScript : PdfAction

The PdfActionJavaScript type exposes the following members.

Constructors
 NameDescription
Public methodPdfActionJavaScript Initializes a new instance of the PdfActionJavaScript class with the script to run.
Top
Properties
 NameDescription
Public propertyJavaScript Gets or sets the JavaScript code executed by this action.
Top
Example
PdfDocument document = new PdfDocument();
document.AddPage();
PdfActionJavaScript action = new PdfActionJavaScript("app.alert('Hello');");
document.OpenAction.Action = action;
document.Save("out.pdf");
document.Close();
See Also