Class PdfDocumentActions
Represents an actions for the PDF document.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfDocumentActions : IPdfWrapper
Examples
//Create a new PDF document
PdfDocument document = new PdfDocument();
//Create and add new launch action to the document
PdfLaunchAction action = new PdfLaunchAction("logo.png");
document.Actions.AfterOpen = action;
//Save the document
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document
Dim document As New PdfDocument()
'Create and add new launch action to the document
Dim action As New PdfLaunchAction("logo.png")
document.Actions.AfterOpen = action
'Save the document
document.Save("LaunchAction.pdf")
document.Close(True)
Properties
AfterOpen
Gets or sets the PdfAction to execute when the document is opened.
Declaration
public PdfAction AfterOpen { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | A PdfAction specifying the action to be executed when documents opens in the viewer. |
Examples
//Create a new PDF document
PdfDocument document = new PdfDocument();
//Create and add new launch action to the document
PdfLaunchAction action = new PdfLaunchAction("logo.png");
document.Actions.AfterOpen = action;
//Save the document
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document
Dim document As New PdfDocument()
'Create and add new launch action to the document
Dim action As New PdfLaunchAction("logo.png")
document.Actions.AfterOpen = action
'Save the document
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
AfterPrint
Gets or sets the action to be performed after the document is printed.
Declaration
public PdfJavaScriptAction AfterPrint { get; set; }
Property Value
Type | Description |
---|---|
PdfJavaScriptAction | A PdfJavaScriptAction object specifying the action to be executed after the document is printed. . |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
//Add a page.
PdfPage page = document.Pages.Add();
//Create JavaScript action
PdfJavaScriptAction javaScriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Add the JavaScript action
document.Actions.AfterPrint = javaScriptAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
'Add a page.
Dim page As PdfPage = document.Pages.Add()
'Create JavaScript action
Dim javaScriptAction As New PdfJavaScriptAction("app.alert(""Hello World!!!"")")
'Add the JavaScript action
document.Actions.AfterPrint = javaScriptAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
See Also
AfterSave
Gets or sets the jave script action to be performed after the document is saved.
Declaration
public PdfJavaScriptAction AfterSave { get; set; }
Property Value
Type | Description |
---|---|
PdfJavaScriptAction | A PdfJavaScriptAction object specifying the action to be executed after the document is saved. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
//Add a page.
PdfPage page = document.Pages.Add();
//Create JavaScript action
PdfJavaScriptAction javaScriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Add the JavaScript action
document.Actions.AfterSave = javaScriptAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
'Add a page.
Dim page As PdfPage = document.Pages.Add()
'Create JavaScript action
Dim javaScriptAction As New PdfJavaScriptAction("app.alert(""Hello World!!!"")")
'Add the JavaScript action
document.Actions.AfterSave = javaScriptAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
See Also
BeforeClose
Gets or sets the java script action to be performed before the document is closed.
Declaration
public PdfJavaScriptAction BeforeClose { get; set; }
Property Value
Type | Description |
---|---|
PdfJavaScriptAction | A PdfJavaScriptAction object specifying the action to be executed before the document is closed. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
//Add a page.
PdfPage page = document.Pages.Add();
//Create JavaScript action
PdfJavaScriptAction javaScriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Add the JavaScript action
document.Actions.BeforeClose = javaScriptAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
'Add a page.
Dim page As PdfPage = document.Pages.Add()
'Create JavaScript action
Dim javaScriptAction As New PdfJavaScriptAction("app.alert(""Hello World!!!"")")
'Add the JavaScript action
document.Actions.BeforeClose = javaScriptAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
See Also
BeforePrint
Gets or sets the action to be performed before the document is printed.
Declaration
public PdfJavaScriptAction BeforePrint { get; set; }
Property Value
Type | Description |
---|---|
PdfJavaScriptAction | A PdfJavaScriptAction object specifying the action to be executed before the document is printed. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
//Add a page.
PdfPage page = document.Pages.Add();
//Create JavaScript action
PdfJavaScriptAction javaScriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Add the JavaScript action
document.Actions.BeforePrint = javaScriptAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
'Add a page.
Dim page As PdfPage = document.Pages.Add()
'Create JavaScript action
Dim javaScriptAction As New PdfJavaScriptAction("app.alert(""Hello World!!!"")")
'Add the JavaScript action
document.Actions.BeforePrint = javaScriptAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
See Also
BeforeSave
Gets or sets the JavaScript action to be performed before the document is saved.
Declaration
public PdfJavaScriptAction BeforeSave { get; set; }
Property Value
Type | Description |
---|---|
PdfJavaScriptAction | A PdfJavaScriptAction object specifying the action to be executed before the document is saved. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
//Add a page.
PdfPage page = document.Pages.Add();
//Create JavaScript action
PdfJavaScriptAction javaScriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Add the JavaScript action
document.Actions.BeforeSave = javaScriptAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
'Add a page.
Dim page As PdfPage = document.Pages.Add()
'Create JavaScript action
Dim javaScriptAction As New PdfJavaScriptAction("app.alert(""Hello World!!!"")")
'Add the JavaScript action
document.Actions.BeforeSave = javaScriptAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)