JavaScriptCollection

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

SignatureDescription
__init__(document: Any)Calls init(document) on this JavaScriptCollection instance.
__len__() → intCalls len on this JavaScriptCollection instance.
__iter__() → Iterator[str]The names, in the order a viewer runs them: key order.
__contains__(name: object) → boolCalls contains(name) on this JavaScriptCollection instance.
__getitem__(name: str) → strCalls getitem(name) on this JavaScriptCollection instance.
get(name: str, default: Any) → AnyThe 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) → boolRemove 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__() → strCalls repr on this JavaScriptCollection instance.

See Also