|
pdfmm 0.9.20
|
#include <PdfFileStream.h>
Public Member Functions | |
| PdfFileStream (PdfObject &parent, PdfOutputDevice &device) | |
| void | SetEncrypted (PdfEncrypt *encrypt) |
| 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 |
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.
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 PdfFileStream writes all data directly to an output device without keeping it in memory. PdfFileStream is used automatically when creating PDF files using PdfImmediateWriter.
| PdfFileStream::PdfFileStream | ( | PdfObject & | parent, |
| PdfOutputDevice & | device | ||
| ) |
Create a new PdfFileStream object which has a parent PdfObject. The stream will be deleted along with the parent. This constructor will be called by PdfObject::Stream() for you.
| parent | parent object |
| device | output device |
|
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.
|
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.
| void PdfFileStream::SetEncrypted | ( | PdfEncrypt * | encrypt | ) |
Set an encryption object which is used to encrypt all data written to this stream.
| encrypt | an encryption object or nullptr if no encryption should be done |
|
overridevirtual |
Write the stream to an output device
| device | write to this outputdevice. |
| encrypt | encrypt stream data using this object |
Implements mm::PdfStream.