Table of Contents

Method Add

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

Add(string, PdfJavaScriptAction)

Adds a named JavaScript action to the collection.

public void Add(string name, PdfJavaScriptAction action)

Parameters

name string

The name to associate with the action.

action PdfJavaScriptAction

The JavaScript action to add.

Remarks

If the collection already contains an action with the specified name, the existing action is replaced. Use Contains(string) to determine whether a name is already present.

The name is an arbitrary string used to identify the action. For example, it can be a generated name such as JS1 or JS2, or a descriptive name such as SetDate or IsValid.

Exceptions

ArgumentNullException

name or action is null.

ArgumentException

action belongs to a different document.

Add(string, string)

Creates a JavaScript action from the specified script contents and adds it to the collection.

public void Add(string name, string scriptContents)

Parameters

name string

The name to associate with the new action.

scriptContents string

The JavaScript code for the new action.

Remarks

If the collection already contains an action with the specified name, the existing action is replaced. Use Contains(string) to determine whether a name is already present.

The name is an arbitrary string used to identify the action. For example, it can be a generated name such as JS1 or JS2, or a descriptive name such as SetDate or IsValid.

Exceptions

ArgumentNullException

name or scriptContents is null.