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
namestringThe name to associate with the action.
actionPdfJavaScriptActionThe 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
nameoractionisnull.- ArgumentException
actionbelongs 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
namestringThe name to associate with the new action.
scriptContentsstringThe 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
nameorscriptContentsisnull.