JavaScriptCollection
Overview
JavaScriptCollection is a class in Aspose.PDF FOSS for Python.
The document’s own scripts, as a mapping of name to source.
This class declares 15 methods for JavaScriptCollection objects in Python programs.
Available methods include: __contains__, __delitem__, __getitem__, __init__, __iter__, __len__, __repr__, __setitem__, add, clear, get, items, and 3 additional methods.
Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Methods
| Signature | Description |
|---|---|
__init__(document: Any) | Calls init(document) on this JavaScriptCollection instance. |
__len__() → int | Calls len on this JavaScriptCollection instance. |
__iter__() → Iterator[str] | The names, in the order a viewer runs them: key order. |
__contains__(name: object) → bool | Calls contains(name) on this JavaScriptCollection instance. |
__getitem__(name: str) → str | Calls getitem(name) on this JavaScriptCollection instance. |
get(name: str, default: Any) → Any | The script name holds, or default. |
__setitem__(name: str, script: str) | Calls setitem(name, script) on this JavaScriptCollection instance. |
add(name: str, script: str) | Define (or replace) the script name. |
__delitem__(name: str) | Calls delitem(name) on this JavaScriptCollection instance. |
remove(name: str) → bool | Remove the script name; True when there was one. |
clear() | Remove every document-level script. |
keys() → list[str] | Calls keys on this JavaScriptCollection instance. |
values() → list[str] | Calls values on this JavaScriptCollection instance. |
items() → list[tuple[str, str]] | Calls items on this JavaScriptCollection instance. |
__repr__() → str | Calls repr on this JavaScriptCollection instance. |