class HexaPDF:: Stream
| Parent | HexaPDF::Dictionary |
|---|
Forward declaration of Stream to circumvent circular require problem
Implements Stream objects of the PDF object system.
Stream Objects¶ ↑
A stream may also be associated with a PDF object but only if the value is a PDF dictionary. This associated dictionary further describes the stream, like its length or how it is encoded.
Such a stream object in PDF contains string data but of possibly unlimited length. Therefore it is used for large amounts of data like images, page descriptions or embedded files.
The basic Object class cannot hold stream data, only this subclass contains the necessary methods to conveniently work with the stream data!
Note that support for external streams (/F, /FFilter, /FDecodeParms) is not yet implemented!
See: PDF2.0 s7.3.8, Dictionary
Field Definitions
| Name | Type/Allowed Values | Required | Default Value |
|---|---|---|---|
| Length | Integer | false | nil |
| Filter | Symbol or HexaPDF::PDFArray or Array | false | nil |
| DecodeParms | HexaPDF::Dictionary or HexaPDF::PDFArray or Hash or Array | false | nil |
| F | HexaPDF::Type::FileSpecification or Hash or String | false | nil |
| FFilter | Symbol or HexaPDF::PDFArray or Array | false | nil |
| FDecodeParms | HexaPDF::Dictionary or HexaPDF::PDFArray or Hash or Array | false | nil |
| DL | Integer | false | nil |
Public Instance Methods
Sets the filters that should be used for encoding the stream.
The arguments filter as well as decode_parms can either be a single items or arrays.
The filters have to be specified in the *decoding order*! For example, if the filters would be [:A85, :Fl], the stream would first be encoded with the Flate and then with the ASCII85 filter.
Assigns a new stream data object.
The stream argument can be a HexaPDF::StreamData object, a String object or nil.
If stream is nil, an empty binary string is used instead.
Returns the decoder Fiber for the stream data.
See the Filter module for more information on how to work with the fiber.
Returns the encoder Fiber for the stream data.
See the Filter module for more information on how to work with the fiber.
Returns the Fiber representing the unprocessed content of the stream.