• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class ActionCollection

An ordered collection of PdfAction objects (spec §12.6). Actions are executed in the order they were added. When serialized, the first action is stored as the /A entry (or /OpenAction for the document catalog) and subsequent actions are chained via /Next entries.

Inheritance
object
ActionCollection
Implements
IList<PdfAction>
ICollection<PdfAction>
IEnumerable<PdfAction>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf.Actions
Assembly: DRIT.Pdf.dll
Syntax
public sealed class ActionCollection : IList<PdfAction>, ICollection<PdfAction>, IEnumerable<PdfAction>, IEnumerable

Properties

Count

Gets the number of actions in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
int

IsReadOnly

Always false — the collection is not read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
bool

this[int]

Gets the action at the specified index.

Declaration
public PdfAction this[int index] { get; set; }
Parameters
Type Name Description
int index
Property Value
Type Description
PdfAction

Methods

Add(PdfAction)

Adds an action to the end of the collection.

Declaration
public void Add(PdfAction item)
Parameters
Type Name Description
PdfAction item

The action to add.

AddGoTo(Destination)

Adds a go-to action using a Destination object.

Declaration
public GoToAction AddGoTo(Destination destination)
Parameters
Type Name Description
Destination destination
Returns
Type Description
GoToAction

AddGoTo(Page, DestinationViewType, params double[])

Adds a go-to action (spec §12.6.4.2) that navigates to a destination within the current document.

Declaration
public GoToAction AddGoTo(Page page, DestinationViewType viewType, params double[] args)
Parameters
Type Name Description
Page page

The target page.

DestinationViewType viewType

How the page should be displayed.

double[] args

View-type-specific arguments.

Returns
Type Description
GoToAction

The created action.

AddGoTo(string)

Adds a go-to action using a named destination string.

Declaration
public GoToAction AddGoTo(string namedDestination)
Parameters
Type Name Description
string namedDestination
Returns
Type Description
GoToAction

AddGoToPageView(Page, DestinationViewType, params double[])

Adds a go-to action that navigates to the given page. Equivalent to AddGoTo(Page, DestinationViewType, params double[]).

Declaration
public GoToAction AddGoToPageView(Page page, DestinationViewType viewType, params double[] args)
Parameters
Type Name Description
Page page
DestinationViewType viewType
double[] args
Returns
Type Description
GoToAction

AddGoToRemote(string, Destination?)

Adds a go-to-remote action (spec §12.6.4.3) that opens a different PDF.

Declaration
public GoToRemoteAction AddGoToRemote(string filePath, Destination? destination = null)
Parameters
Type Name Description
string filePath
Destination destination
Returns
Type Description
GoToRemoteAction

AddJavaScript(string)

Adds a JavaScript action (spec §12.6.4.15) that executes a script.

Declaration
public JavaScriptAction AddJavaScript(string script)
Parameters
Type Name Description
string script
Returns
Type Description
JavaScriptAction

AddLaunch(string)

Adds a launch action (spec §12.6.4.5) that opens a file or application.

Declaration
public LaunchAction AddLaunch(string filePath)
Parameters
Type Name Description
string filePath
Returns
Type Description
LaunchAction

AddOpenFile(string)

Adds a launch action that opens the given local file. Equivalent to AddLaunch(string).

Declaration
public LaunchAction AddOpenFile(string filePath)
Parameters
Type Name Description
string filePath
Returns
Type Description
LaunchAction

AddOpenWebLink(string)

Adds a URI action that opens the given URL in a web browser. Equivalent to AddUri(string).

Declaration
public UriAction AddOpenWebLink(string url)
Parameters
Type Name Description
string url
Returns
Type Description
UriAction

AddUri(string)

Adds a URI action (spec §12.6.4.7) that resolves a uniform resource identifier.

Declaration
public UriAction AddUri(string uri)
Parameters
Type Name Description
string uri
Returns
Type Description
UriAction

Clear()

Removes all actions from the collection.

Declaration
public void Clear()

Contains(PdfAction)

Determines whether the collection contains the specified action.

Declaration
public bool Contains(PdfAction item)
Parameters
Type Name Description
PdfAction item
Returns
Type Description
bool

CopyTo(PdfAction[], int)

Copies the actions to an array starting at the specified index.

Declaration
public void CopyTo(PdfAction[] array, int arrayIndex)
Parameters
Type Name Description
PdfAction[] array
int arrayIndex

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<PdfAction> GetEnumerator()
Returns
Type Description
IEnumerator<PdfAction>

IndexOf(PdfAction)

Determines the index of a specific action.

Declaration
public int IndexOf(PdfAction item)
Parameters
Type Name Description
PdfAction item
Returns
Type Description
int

Insert(int, PdfAction)

Inserts an action at the specified index.

Declaration
public void Insert(int index, PdfAction item)
Parameters
Type Name Description
int index
PdfAction item

Remove(PdfAction)

Removes the first occurrence of the specified action.

Declaration
public bool Remove(PdfAction item)
Parameters
Type Name Description
PdfAction item
Returns
Type Description
bool

RemoveAt(int)

Removes the action at the specified index.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

Implements

IList<T>
ICollection<T>
IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX