JavaScriptCollection

JavaScriptCollection

Overview

JavaScriptCollection is a type in Aspose.PDF FOSS for Go.

JavaScriptCollection is the document-level JavaScript store, backed by the /Catalog/Names/JavaScript name tree (ISO 32000-1 §7.7.4 / §8.5.1).

This type provides 7 methods for working with JavaScriptCollection objects in Go programs. Available methods include: Add, Clear, Count, Get, Has, Names, Remove. All public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

Methods

SignatureDescription
Count()intCount reports how many named scripts are in the collection.
Has(name: string)boolHas reports whether a script with the given name exists.
Get(name: string)stringGet returns the script registered under name, or "" if absent.
Names()[]stringNames returns the script names in lexical order (the order they are written to the name tree).
Add(name: string)errorAdd registers (or replaces) a named script and writes it through to the /Catalog/Names/JavaScript name tree.
Remove(name: string)boolRemove deletes the named script.
Clear()Clear removes every named script.

See Also