Class PdfActionDestination
Specifies the available named actions supported by the viewer.
Inheritance
System.Object
PdfActionDestination
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public sealed class PdfActionDestination : Enum
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page
PdfPage page = document.Pages.Add();
//Creates a new page
page = document.Pages.Add();
//Creates a new page
page = document.Pages.Add();
//Creates a new page
page = document.Pages.Add();
//Creates a new page
page = document.Pages.Add();
//Create font and font style.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold) ;
//Create a new PdfButtonField.
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
//Set the bounds to submitButton.
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
//Set the font to submitButton.
submitButton.Font = font;
//Sets the submit button text.
submitButton.Text = "First Page";
//Set the back color to submit button.
submitButton.BackColor = new PdfColor(181, 191, 203);
//Create a new PdfNamedAction.
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.FirstPage);
//Set the named action destination.
namedAction.Destination=PdfActionDestination.PrevPage;
//Set the Actions to namedAction.
submitButton.Actions.GotFocus = namedAction;
//Add the submitButton to the new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("ActionDestination.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Creates a new page
Dim page As PdfPage = document.Pages.Add()
'Creates a new page
page = document.Pages.Add()
'Creates a new page
page = document.Pages.Add()
'Creates a new page
page = document.Pages.Add()
'Create font and font style.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold)
'Create a new PdfButtonField
Dim submitButton As PdfButtonField = New PdfButtonField(page, "submitButton")
'Set the bounds to submit button.
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
'Set the font to submitButton.
submitButton.Font = font
'Sets the submit button text.
submitButton.Text = "First Page"
'Set the back color to submit button.
submitButton.BackColor = new PdfColor(181, 191, 203)
'Create a new PdfNamedAction
Dim namedAction As PdfNamedAction = new PdfNamedAction(PdfActionDestination.FirstPage)
'Set the named action.
namedAction.Destination=PdfActionDestination.PrevPage
'Set the Actions to namedAction.
submitButton.Actions.GotFocus = namedAction
'Add the submitButton to the new document.
document.Form.Fields.Add(gotoAction)
'Save document to disk.
document.Save("ActionDestination.pdf")
document.Close(True)
Fields
FirstPage
Navigate to first page.
Declaration
public const PdfActionDestination FirstPage
Field Value
Type |
---|
PdfActionDestination |
LastPage
Navigate to last page.
Declaration
public const PdfActionDestination LastPage
Field Value
Type |
---|
PdfActionDestination |
NextPage
Navigate to next page.
Declaration
public const PdfActionDestination NextPage
Field Value
Type |
---|
PdfActionDestination |
PrevPage
Navigate to previous page.
Declaration
public const PdfActionDestination PrevPage
Field Value
Type |
---|
PdfActionDestination |