PdfStream
Overview
PdfStream is a class in Aspose.PDF FOSS for Python.
Inherits from: PdfDictionary.
A stream object: a dictionary plus a byte payload.
This class declares 9 methods for PdfStream objects in Python programs.
Available methods include: __contains__, __delitem__, __getitem__, __init__, __repr__, __setitem__, get, pop.
Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Properties: content, content_decrypted, mapping.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
content | bytes | Read | Gets the content. |
content_decrypted | bool | Read | Gets the content decrypted. |
mapping | dict[PdfName, PdfObject] | Read | Gets the mapping. |
Methods
| Signature | Description |
|---|---|
__init__(content: bytes, mapping: dict[PdfName, PdfObject] | None) | Calls init(content, mapping) on this PdfStream instance. |
__repr__() → str | Calls repr on this PdfStream instance. |
__init__(mapping: dict[PdfName, PdfObject] | None) | Calls init(mapping) on this PdfStream instance. |
__getitem__(key: PdfName) → PdfObject | Calls getitem(key) on this PdfStream instance. |
__setitem__(key: PdfName, value: PdfObject) | Calls setitem(key, value) on this PdfStream instance. |
__delitem__(key: PdfName) | Calls delitem(key) on this PdfStream instance. |
__contains__(key: PdfName) → bool | Calls contains(key) on this PdfStream instance. |
get(key: PdfName, default: Any) → Any | Retrieves a value from the underlying dictionary of a PDF stream, returning the default when the key is absent |
pop(key: PdfName, default: Any) → Any | Removes the entry for the given key from the stream dictionary and returns its value, or the default if the key does not exist |