PoDoFo 0.9.6
|
#include <PdfMemStream.h>
Public Member Functions | |
PdfMemStream (PdfObject *pParent) | |
PdfMemStream (const PdfMemStream &rhs) | |
virtual void | Write (PdfOutputDevice *pDevice, PdfEncrypt *pEncrypt=NULL) |
virtual void | GetCopy (char **pBuffer, pdf_long *lLen) const |
virtual void | GetCopy (PdfOutputStream *pStream) const |
const char * | Get () const |
virtual pdf_long | GetLength () const |
void | FlateCompress () |
void | Uncompress () |
void | Empty () |
const PdfStream & | operator= (const PdfStream &rhs) |
![]() | |
PdfStream (PdfObject *pParent) | |
virtual void | Write (PdfOutputDevice *pDevice, PdfEncrypt *pEncrypt=NULL)=0 |
void | Set (const char *szBuffer, pdf_long lLen, const TVecFilters &vecFilters) |
void | Set (const char *szBuffer, pdf_long lLen) |
void | Set (PdfInputStream *pStream) |
void | Set (PdfInputStream *pStream, const TVecFilters &vecFilters) |
void | Set (const char *pszString) |
void | SetRawData (PdfInputStream *pStream, pdf_long lLen=-1) |
void | BeginAppend (bool bClearExisting=true) |
void | BeginAppend (const TVecFilters &vecFilters, bool bClearExisting=true, bool bDeleteFilters=true) |
void | Append (const char *pszString, size_t lLen) |
void | Append (const char *pszString) |
void | Append (const std::string &sString) |
void | EndAppend () |
bool | IsAppending () const |
virtual pdf_long | GetLength () const =0 |
virtual void | GetCopy (char **pBuffer, pdf_long *lLen) const =0 |
virtual void | GetCopy (PdfOutputStream *pStream) const =0 |
void | GetFilteredCopy (char **pBuffer, pdf_long *lLen) const |
void | GetFilteredCopy (PdfOutputStream *pStream) const |
const PdfStream & | operator= (const PdfStream &rhs) |
Protected Member Functions | |
virtual const char * | GetInternalBuffer () const |
virtual pdf_long | GetInternalBufferSize () const |
virtual void | BeginAppendImpl (const TVecFilters &vecFilters) |
virtual void | AppendImpl (const char *pszString, size_t lLen) |
virtual void | EndAppendImpl () |
virtual const char * | GetInternalBuffer () const =0 |
virtual pdf_long | GetInternalBufferSize () const =0 |
virtual void | BeginAppendImpl (const TVecFilters &vecFilters)=0 |
virtual void | AppendImpl (const char *pszString, size_t lLen)=0 |
virtual void | EndAppendImpl ()=0 |
Additional Inherited Members | |
![]() | |
static enum EPdfFilter | eDefaultFilter |
A PDF stream can be appended to any PdfObject and can contain arbitrary data.
A PDF memory stream is held completely in memory.
Most of the time it will contain either drawing commands to draw onto a page or binary data like a font or an image.
A PdfMemStream is implicitly shared and can therefore be copied very quickly.
PoDoFo::PdfMemStream::PdfMemStream | ( | PdfObject * | pParent | ) |
PoDoFo::PdfMemStream::PdfMemStream | ( | const PdfMemStream & | rhs | ) |
Create a shallow copy of a PdfStream object
rhs | the object to clone |
|
protectedvirtual |
Append a binary buffer to the current stream contents.
pszString | a buffer |
lLen | length of the buffer |
Implements PoDoFo::PdfStream.
|
protectedvirtual |
Begin appending data to this stream. Clears the current stream contents.
vecFilters | use this filters to encode any data written to the stream. |
Implements PoDoFo::PdfStream.
void PoDoFo::PdfMemStream::Empty | ( | ) |
Empties the stream and set the streams buffer size to 0
|
protectedvirtual |
Finish appending data to the stream
Implements PoDoFo::PdfStream.
void PoDoFo::PdfMemStream::FlateCompress | ( | ) |
This function compresses any currently set stream using the FlateDecode(ZIP) algorithm. JPEG compressed streams will not be compressed again using this function. Entries to the filter dictionary will be added if necessary.
|
inline |
Get a read-only handle to the current stream data. The data will not be filtered before being returned, so (eg) calling Get() on a Flate compressed stream will return a pointer to the Flate-compressed buffer.
|
virtual |
Get a malloced buffer of the current stream. No filters will be applied to the buffer, so if the stream is Flate compressed the compressed copy will be returned.
The caller has to podofo_free() the buffer.
pBuffer | pointer to where the buffer's address will be stored |
lLen | pointer to the buffer length (output parameter) |
Implements PoDoFo::PdfStream.
|
virtual |
Get a copy of a the stream and write it to a PdfOutputStream
pStream | data is written to this stream. |
Implements PoDoFo::PdfStream.
|
inlineprotectedvirtual |
Required for the GetFilteredCopy implementation
Implements PoDoFo::PdfStream.
|
inlineprotectedvirtual |
Required for the GetFilteredCopy implementation
Implements PoDoFo::PdfStream.
|
virtual |
Get the stream's length. The length is that of the internal stream buffer, so (eg) for a Flate-compressed stream it will be the length of the compressed data.
Implements PoDoFo::PdfStream.
Create a copy of a PdfStream object
rhs | the object to clone |
void PoDoFo::PdfMemStream::Uncompress | ( | ) |
This method removes all filters from the stream
|
virtual |
Write the stream to an output device
pDevice | write to this outputdevice. |
pEncrypt | encrypt stream data using this object |
Implements PoDoFo::PdfStream.