Represents a PDF stream object.
A stream contains:
- a PDF dictionary;
- the raw stream data;
- an optional list of filters.
The serializer is responsible for applying the filters, calculating
/Length, and adding the corresponding /Filter entry.
Example
%PaperForge.Stream{
dictionary: %{},
data: "BT /F1 12 Tf ET",
filters: [:flate]
}
Summary
Functions
Adds a filter to a stream.
Creates a new PDF stream.
Adds or replaces a dictionary entry.
Replaces the stream data.
Replaces the stream dictionary.
Returns the unfiltered stream data as a binary.
Types
Functions
Adds a filter to a stream.
Duplicate filters are not added.
Example
stream =
stream
|> PaperForge.Stream.add_filter(:flate)
Creates a new PDF stream.
Supported options:
:dictionary:filters
Examples
PaperForge.Stream.new(
"Hello PDF"
)
PaperForge.Stream.new(
"Compressed content",
filters: [:flate]
)
PaperForge.Stream.new(
jpeg_binary,
dictionary: %{
"Type" => {:name, "XObject"},
"Subtype" => {:name, "Image"},
"Filter" => {:name, "DCTDecode"}
}
)
Adds or replaces a dictionary entry.
Replaces the stream data.
Replaces the stream dictionary.
Returns the unfiltered stream data as a binary.