Table of Contents

Class PdfAction

Namespace
nebulae.dotPDFium
Assembly
dotPDFium.dll

Represents an action within a PDF document, such as a hyperlink or a named action.

public sealed class PdfAction
Inheritance
PdfAction
Inherited Members

Remarks

A PdfAction encapsulates a specific action defined in a PDF document. Actions can include navigating to a URI, executing a named action, or other types of actions as defined by the PDF specification. Use the Type property to determine the type of action and the appropriate methods to retrieve additional details.

Properties

Type

Gets the type of the PDF action represented by this instance.

public PdfActionType Type { get; }

Property Value

PdfActionType

Methods

GetDestination(PdfDocument)

Retrieves the destination associated with the current action in the specified PDF document.

public PdfDestination? GetDestination(PdfDocument doc)

Parameters

doc PdfDocument

The PdfDocument instance representing the PDF document containing the action.

Returns

PdfDestination

A PdfDestination object representing the destination associated with the action, or null if no destination is associated.

Remarks

The destination represents a specific location within the PDF document, such as a page or a view. Use this method to navigate to or retrieve information about the target location of the action.

GetFilePath()

Retrieves the file path associated with the current PDF action.

public string? GetFilePath()

Returns

string

The file path as a string, or null if no file path is associated with the action.

Remarks

The returned file path is decoded using UTF-8 encoding and may be trimmed of any trailing null characters.

GetNamedAction()

Retrieves the name of a named action.

public string? GetNamedAction()

Returns

string

Always returns null as the underlying implementation does not support retrieving the name of named actions.

GetUri(PdfDocument)

Retrieves the URI associated with the specified PDF document action.

public string? GetUri(PdfDocument doc)

Parameters

doc PdfDocument

The PdfDocument containing the action for which the URI is retrieved.

Returns

string

The URI as a string if the action has an associated URI; otherwise, null.

Remarks

The returned URI is encoded in UTF-8 and may include a null terminator, which is removed before returning the result.