PoDoFo  0.9.20
Public Member Functions | List of all members
PoDoFo::PdfObjectStream Class Referencefinal

#include <PdfObjectStream.h>

Public Member Functions

void SetData (const bufferview &buffer, bool raw=false)
 
void SetData (const bufferview &buffer, const PdfFilterList &filters, bool raw=false)
 
void SetData (InputStream &stream, bool raw=false)
 
void SetData (InputStream &stream, const PdfFilterList &filters, bool raw=false)
 
charbuff GetCopy (bool raw=false) const
 
charbuff GetCopySafe () const
 
void CopyTo (charbuff &buffer, bool raw=false) const
 
void CopyToSafe (charbuff &buffer) const
 
void CopyTo (OutputStream &stream, bool raw=false) const
 
void CopyToSafe (OutputStream &stream) const
 
void Unwrap ()
 
size_t GetLength () const
 
PdfObjectStreamoperator= (const PdfObjectStream &rhs)
 

Detailed Description

A PDF stream can be appended to any PdfObject and can contain arbitrary data.

Most of the time it will contain either drawing commands to draw onto a page or binary data like a font or an image.

You have to use a concrete implementation of a stream, which can be retrieved from a StreamFactory.

See also
PdfIndirectObjectList
PdfMemoryObjectStream
PdfFileObjectStream

Member Function Documentation

void PdfObjectStream::CopyTo ( charbuff buffer,
bool  raw = false 
) const

Unwrap the stream to the given buffer, unpacking non media filters

Remarks
throws if the stream contains media filters, like DCTDecode
void PdfObjectStream::CopyTo ( OutputStream stream,
bool  raw = false 
) const

Unwrap the stream and write it to the given stream, unpacking non media filters

Remarks
throws if the stream contains media filters, like DCTDecode
void PdfObjectStream::CopyToSafe ( charbuff buffer) const

Unwrap the stream to the given buffer, unpacking non media filters

void PdfObjectStream::CopyToSafe ( OutputStream stream) const

Unwrap the stream and write it to the given stream, unpacking non media filters

charbuff PdfObjectStream::GetCopy ( bool  raw = false) const

Get an unwrapped copy of the stream, unpacking non media filters

Remarks
throws if the stream contains media filters, like DCTDecode
charbuff PdfObjectStream::GetCopySafe ( ) const

Get an unwrapped copy of the stream, unpacking non media filters

size_t PdfObjectStream::GetLength ( ) const

Get the stream's length with all filters applied (e.g. if the stream is Flate-compressed, the length of the compressed data stream).

Returns
the length of the internal buffer
PdfObjectStream & PdfObjectStream::operator= ( const PdfObjectStream rhs)

Create a copy of a PdfObjectStream object

Parameters
rhsthe object to clone
Returns
a reference to this object
void PdfObjectStream::SetData ( const bufferview buffer,
bool  raw = false 
)

Set the data contents copying from a buffer All data will be Flate-encoded.

Parameters
bufferbuffer containing the stream data
void PdfObjectStream::SetData ( const bufferview buffer,
const PdfFilterList &  filters,
bool  raw = false 
)

Set the data contents copying from a buffer

Use PdfFilterFactory::CreateFilterList() if you want to use the contents of the stream dictionary's existing filter key.

Parameters
bufferbuffer containing the stream data
filtersa list of filters to use when appending data
void PdfObjectStream::SetData ( InputStream stream,
bool  raw = false 
)

Set the data contents reading from an InputStream All data will be Flate-encoded.

Parameters
streamread stream contents from this InputStream
void PdfObjectStream::SetData ( InputStream stream,
const PdfFilterList &  filters,
bool  raw = false 
)

Set the data contents reading from an InputStream

Use PdfFilterFactory::CreateFilterList() if you want to use the contents of the stream dictionary's existing filter key.

Parameters
streamread stream contents from this InputStream
filtersa list of filters to use when appending data
void PdfObjectStream::Unwrap ( )

Unpack non media filters