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
ActionCollection
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
IsReadOnly
Always false — the collection is not read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
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
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)
Declaration
public GoToAction AddGoTo(Destination destination)
Parameters
Returns
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
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
AddGoToPageView(Page, DestinationViewType, params double[])
Declaration
public GoToAction AddGoToPageView(Page page, DestinationViewType viewType, params double[] args)
Parameters
Returns
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
Returns
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
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
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
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
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
Clear()
Removes all actions from the collection.
Declaration
Contains(PdfAction)
Determines whether the collection contains the specified action.
Declaration
public bool Contains(PdfAction item)
Parameters
Returns
CopyTo(PdfAction[], int)
Copies the actions to an array starting at the specified index.
Declaration
public void CopyTo(PdfAction[] array, int arrayIndex)
Parameters
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<PdfAction> GetEnumerator()
Returns
IndexOf(PdfAction)
Determines the index of a specific action.
Declaration
public int IndexOf(PdfAction item)
Parameters
Returns
Insert(int, PdfAction)
Inserts an action at the specified index.
Declaration
public void Insert(int index, PdfAction item)
Parameters
Remove(PdfAction)
Removes the first occurrence of the specified action.
Declaration
public bool Remove(PdfAction item)
Parameters
Returns
RemoveAt(int)
Removes the action at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
Implements