Class PdfNamedAction
The class represents an named action which execute an action predefined by the viewer application.
Implements
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public class PdfNamedAction : PdfAction, IPdfWrapper
Examples
//Create a new document
PdfDocument document = new PdfDocument();
document.Pages.Add();
document.Pages.Add();
//Create a named action
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.LastPage);
//Add the named action
document.Actions.AfterOpen = namedAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
document.Pages.Add()
document.Pages.Add()
'Create a named action
Dim namedAction As New PdfNamedAction(PdfActionDestination.LastPage)
'Add the named action
document.Actions.AfterOpen = namedAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Constructors
PdfNamedAction(PdfActionDestination)
Initializes a new instance of the PdfNamedAction class.
Declaration
public PdfNamedAction(PdfActionDestination destination)
Parameters
Type | Name | Description |
---|---|---|
PdfActionDestination | destination | The PdfActionDestination object representing destination of an action. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
document.Pages.Add();
document.Pages.Add();
//Create a named action
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.LastPage);
//Set the destination
namedAction.Destination = PdfActionDestination.NextPage;
//Add the named action
document.Actions.AfterOpen = namedAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
document.Pages.Add()
document.Pages.Add()
'Create a named action
Dim namedAction As New PdfNamedAction(PdfActionDestination.LastPage)
'Set the destination
namedAction.Destination = PdfActionDestination.NextPage
'Add the named action
document.Actions.AfterOpen = namedAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Properties
Destination
Gets or sets the destination.
Declaration
public PdfActionDestination Destination { get; set; }
Property Value
Type | Description |
---|---|
PdfActionDestination | The PdfActionDestination object representing destination of an action. |
Examples
//Create a new document
PdfDocument document = new PdfDocument();
document.Pages.Add();
document.Pages.Add();
//Create a named action
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.LastPage);
//Set the destination
namedAction.Destination = PdfActionDestination.NextPage;
//Add the named action
document.Actions.AfterOpen = namedAction;
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Create a new document
Dim document As New PdfDocument()
document.Pages.Add()
document.Pages.Add()
'Create a named action
Dim namedAction As New PdfNamedAction(PdfActionDestination.LastPage)
'Set the destination
namedAction.Destination = PdfActionDestination.NextPage
'Add the named action
document.Actions.AfterOpen = namedAction
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Methods
Initialize()
Initializes instance.
Declaration
protected override void Initialize()