|
pdfmm 0.9.20
|
#include <PdfMemStream.h>
Public Member Functions | |
| PdfMemStream (PdfObject &parent) | |
| void | Write (PdfOutputDevice &device, const PdfEncrypt *encrypt) override |
| void | GetCopy (std::unique_ptr< char[]> &buffer, size_t &len) const override |
| void | GetCopy (PdfOutputStream &stream) const override |
| size_t | GetLength () const override |
| const char * | Get () const |
Public Member Functions inherited from mm::PdfStream | |
| virtual void | Write (PdfOutputDevice &device, const PdfEncrypt *encrypt)=0 |
| void | Set (const std::string_view &view, const PdfFilterList &filters) |
| void | Set (const char *buffer, size_t len, const PdfFilterList &filters) |
| void | Set (const std::string_view &view) |
| void | Set (const char *buffer, size_t len) |
| void | Set (PdfInputStream &stream) |
| void | Set (PdfInputStream &stream, const PdfFilterList &filters) |
| void | SetRawData (PdfInputStream &stream, ssize_t len=-1) |
| void | BeginAppend (bool clearExisting=true) |
| void | BeginAppend (const PdfFilterList &filters, bool clearExisting=true, bool deleteFilters=true) |
| PdfStream & | Append (const std::string_view &view) |
| PdfStream & | Append (const char *buffer, size_t len) |
| void | EndAppend () |
| bool | IsAppending () const |
| virtual size_t | GetLength () const =0 |
| virtual void | GetCopy (std::unique_ptr< char[]> &buffer, size_t &len) const =0 |
| virtual void | GetCopy (PdfOutputStream &stream) const =0 |
| void | GetFilteredCopy (std::unique_ptr< char[]> &buffer, size_t &len) const |
| void | GetFilteredCopy (PdfOutputStream &stream) const |
| const PdfStream & | operator= (const PdfStream &rhs) |
Protected Member Functions | |
| const char * | GetInternalBuffer () const override |
| size_t | GetInternalBufferSize () const override |
| void | BeginAppendImpl (const PdfFilterList &filters) override |
| void | AppendImpl (const char *data, size_t len) override |
| void | EndAppendImpl () override |
Protected Member Functions inherited from mm::PdfStream | |
| PdfStream (PdfObject &parent) | |
| virtual const char * | GetInternalBuffer () const =0 |
| virtual size_t | GetInternalBufferSize () const =0 |
| virtual void | BeginAppendImpl (const PdfFilterList &filters)=0 |
| virtual void | AppendImpl (const char *data, size_t len)=0 |
| virtual void | EndAppendImpl ()=0 |
Additional Inherited Members | |
Static Public Attributes inherited from mm::PdfStream | |
| static enum PdfFilterType | DefaultFilter |
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.
| PdfMemStream::PdfMemStream | ( | PdfObject & | parent | ) |
|
overrideprotectedvirtual |
Append a binary buffer to the current stream contents.
| data | a buffer |
| len | length of the buffer |
Implements mm::PdfStream.
|
overrideprotectedvirtual |
Begin appending data to this stream. Clears the current stream contents.
Use PdfFilterFactory::CreateFilterList() if you want to use the contents of the stream dictionary's existing filter key.
| filters | use these filters to encode any data written to the stream. |
Implements mm::PdfStream.
|
overrideprotectedvirtual |
Finish appending data to the stream
Implements mm::PdfStream.
| const char * PdfMemStream::Get | ( | ) | const |
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.
|
overridevirtual |
Get a copy of a the stream and write it to a PdfOutputStream
| stream | data is written to this stream. |
Implements mm::PdfStream.
|
overridevirtual |
Get a malloc()'d 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 the buffer.
| buffer | pointer to the buffer |
| len | pointer to the buffer length |
Implements mm::PdfStream.
|
overrideprotectedvirtual |
Required for the GetFilteredCopy() implementation
Implements mm::PdfStream.
|
overrideprotectedvirtual |
Required for the GetFilteredCopy() implementation
Implements mm::PdfStream.
|
overridevirtual |
Get the stream's length with all filters applied (e.g. if the stream is Flate-compressed, the length of the compressed data stream).
Implements mm::PdfStream.
|
overridevirtual |
Write the stream to an output device
| device | write to this outputdevice. |
| encrypt | encrypt stream data using this object |
Implements mm::PdfStream.