PdfStream class
Namespace: PdfNetStack.Objects
Assembly: PdfNetStack.dll
Package: PdfNetStack
A PDF stream: a dictionary plus encoded data. Streams are always indirect objects; add new ones with AddObject and refer to the returned reference.
public sealed class PdfStream : PdfObjectInheritance
object ← PdfObject ← PdfStream
Constructors
Section titled “Constructors”PdfStream(PdfDictionary, ReadOnlyMemory<byte>)
Section titled “ PdfStream(PdfDictionary, ReadOnlyMemory<byte>)”Creates a stream from data already encoded as the dictionary’s /Filter says.
public PdfStream(PdfDictionary dictionary, ReadOnlyMemory<byte> data)Parameters
Section titled “Parameters”dictionary PdfDictionary
data ReadOnlyMemory<byte>
Properties
Section titled “Properties”Encoded stream bytes, exactly as stored between stream and endstream. For a document opened from a stream without loading it, the bytes are read from the file on each access and not kept, until new data is assigned.
public ReadOnlyMemory<byte> Data { get; set; }Property Value
Section titled “Property Value”Dictionary
Section titled “ Dictionary”The stream dictionary. /Length is written on save and need not be kept current.
public PdfDictionary Dictionary { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”FromData(ReadOnlySpan<byte>, PdfDictionary?, bool)
Section titled “ FromData(ReadOnlySpan<byte>, PdfDictionary?, bool)”Creates a stream from plain data, Flate compressed unless compress is
false. /Filter and /DecodeParms of dictionary are replaced to match.
public static PdfStream FromData(ReadOnlySpan<byte> data, PdfDictionary? dictionary = null, bool compress = true)Parameters
Section titled “Parameters”data ReadOnlySpan<byte>
dictionary PdfDictionary?
compress bool