menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfActionDestination - API Reference

    Show / Hide Table of Contents

    Class PdfActionDestination

    Specifies the available named actions supported by the viewer.

    Inheritance
    System.Object
    PdfActionDestination
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.UWP.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 Description
    PdfActionDestination

    LastPage

    Navigate to last page.

    Declaration
    public const PdfActionDestination LastPage
    Field Value
    Type Description
    PdfActionDestination

    NextPage

    Navigate to next page.

    Declaration
    public const PdfActionDestination NextPage
    Field Value
    Type Description
    PdfActionDestination

    PrevPage

    Navigate to previous page.

    Declaration
    public const PdfActionDestination PrevPage
    Field Value
    Type Description
    PdfActionDestination

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved