PDF::Objects::Stream
Inherits PDF::Objects::Base < Reference < Object
Represents a PDF stream object.
A stream consists of a dictionary followed by binary data. The dictionary must contain at least a /Length entry specifying the number of bytes in the stream data.
Streams are used for page content, images, fonts, and other binary data. They can be compressed using various filters.
stream = PDF::Objects::Stream.new
stream.data = "BT /F1 12 Tf 72 720 Td (Hello) Tj ET"
stream.to_pdf
# => "<</Length 38>>\nstream\nBT /F1 12 Tf 72 720 Td (Hello) Tj ET\nendstream"
Note: When used as an indirect object, the stream is typically compressed with FlateDecode for smaller file size.
Constructors
new
SourceInstance methods
[]?(key : Name) : Base | Nil
SourceSerializes this object to an IO.
By default, this writes the result of #to_pdf to the IO.
Subclasses may override for more efficient streaming.