PdfStreams

object PdfStreams

Builders for stream objects to hand to the writer (PdfEditor).

/Length is informational here — PdfObjectWriter always rewrites it to the actual serialized payload size — but it's set for a self-consistent dict.

Functions

Link copied to clipboard
fun flate(data: ByteArray, extra: Map<String, PdfObject> = emptyMap()): PdfStream

A /FlateDecode stream compressing uncompressed data. extra supplies additional dictionary entries (e.g. /Type, /Subtype); do not pass /Filter in extra — this always sets it to /FlateDecode.

Link copied to clipboard
fun raw(data: ByteArray, extra: Map<String, PdfObject> = emptyMap()): PdfStream

A stream with no encoding filter, holding data verbatim.