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

NameTypeAccessDescription
contentbytesReadGets the content.
content_decryptedboolReadGets the content decrypted.
mappingdict[PdfName, PdfObject]ReadGets the mapping.

Methods

SignatureDescription
__init__(content: bytes, mapping: dict[PdfName, PdfObject] | None)Calls init(content, mapping) on this PdfStream instance.
__repr__() → strCalls repr on this PdfStream instance.
__init__(mapping: dict[PdfName, PdfObject] | None)Calls init(mapping) on this PdfStream instance.
__getitem__(key: PdfName) → PdfObjectCalls 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) → boolCalls contains(key) on this PdfStream instance.
get(key: PdfName, default: Any) → AnyRetrieves a value from the underlying dictionary of a PDF stream, returning the default when the key is absent
pop(key: PdfName, default: Any) → AnyRemoves the entry for the given key from the stream dictionary and returns its value, or the default if the key does not exist

See Also