Enum PdfActionDestination
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Specifies the available named actions supported by the viewer.
public enum PdfActionDestination
Fields
FirstPage = 0
Navigate to first page.
LastPage = 1
Navigate to last page.
NextPage = 2
Navigate to next page.
PrevPage = 3
Navigate to previous page.
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)