menu

Document Processing

PdfAction Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfAction Class

    Represents base class for all action types.

    Inheritance
    System.Object
    PdfAction
    PdfFormAction
    PdfGoToAction
    PdfJavaScriptAction
    PdfLaunchAction
    PdfNamedAction
    PdfRemoteGoToAction
    PdfSoundAction
    PdfUriAction
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public abstract class PdfAction : Object, IPdfWrapper

    Constructors

    PdfAction()

    Initializes a new instance of the PdfAction class.

    Declaration
    protected PdfAction()

    Properties

    Next

    Gets or sets the next action to be performed after the action represented by this instance.

    Declaration
    public PdfAction Next { get; set; }
    Property Value
    Type
    PdfAction
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Creates a new page and adds it as the last page of the document.
    PdfPage page = document.Pages.Add();
    //Create a new sound action.
    PdfSoundAction soundAction = new PdfSoundAction(@"startup.wav");
    soundAction.Sound.Bits = 16;
    soundAction.Sound.Channels = PdfSoundChannels.Stereo;
    soundAction.Sound.Encoding = PdfSoundEncoding.Signed;
    soundAction.Volume = 0.9f;
    soundAction.Mix = true;
    //Create a new PdfUriAction.
    PdfUriAction uriAction = new PdfUriAction("http://www.google.com");
    //Set the next action to the soundAction.
    soundAction.Next = uriAction;
    //Set the action.
    document.Actions.AfterOpen = soundAction;
    //Save document to disk.
    document.Save("output.pdf");
    //close the document.
    document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Creates a new page and adds it as the last page of the document.
    Dim page As PdfPage = document.Pages.Add()
    'Create a new sound action.
    Dim soundAction As New PdfSoundAction("startup.wav")
    soundAction.Sound.Bits = 16
    soundAction.Sound.Channels = PdfSoundChannels.Stereo
    soundAction.Sound.Encoding = PdfSoundEncoding.Signed
    soundAction.Volume = 0.9F
    soundAction.Mix = True
    'Create a new PdfUriAction.
    Dim uriAction As New PdfUriAction("http://www.google.com")
    'Set the next action to the soundAction.
    soundAction.[Next] = uriAction
    'Set the action.
    document.Actions.AfterOpen = soundAction
    'Save document to disk.
    document.Save("output.pdf")
    'close the document.
    document.Close(True)
    See Also
    PdfPage
    PdfSoundAction
    PdfUriAction

    Methods

    Initialize()

    Initializes an instance.

    Declaration
    protected virtual void Initialize()

    See Also

    Syncfusion.Pdf.IPdfWrapper
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved