PoDoFo 0.9.20
PoDoFo::PdfData Class Referencefinal

#include <PdfData.h>

Inheritance diagram for PoDoFo::PdfData:
PoDoFo::PdfDataProvider

Public Member Functions

 PdfData (charbuff &&data, const std::shared_ptr< size_t > &writeBeacon={ })
 
 PdfData (const bufferview &data, const std::shared_ptr< size_t > &writeBeacon={ })
 
void Write (OutputStream &stream, PdfWriteFlags writeMode, const PdfStatefulEncrypt &encrypt, charbuff &buffer) const override
 
const charbuffGetBuffer () const
 
- Public Member Functions inherited from PoDoFo::PdfDataProvider
std::string ToString () const
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfDataProvider
 PdfDataProvider ()
 

Detailed Description

A datatype that allows to write arbitrary data to a PDF file. The user of this class has to ensure that the data written to the PDF file using this class is valid data for a PDF file!

Constructor & Destructor Documentation

◆ PdfData() [1/2]

PdfData::PdfData ( charbuff && data,
const std::shared_ptr< size_t > & writeBeacon = { } )

Create a new PdfData object with valid PdfData

The contained data has to be a valid value in a PDF file. It will be written directly to the PDF file.

Parameters
writeBeaconShared sentinel that will updated during writing of the document with the current position in the stream

◆ PdfData() [2/2]

PdfData::PdfData ( const bufferview & data,
const std::shared_ptr< size_t > & writeBeacon = { } )
explicit

Create a new PdfData object with valid PdfData

The contained data has to be a valid value in a PDF file. It will be written directly to the PDF file.

Parameters
writeBeaconShared sentinel that will updated during writing of the document with the current position in the stream

Member Function Documentation

◆ GetBuffer()

const charbuff & PoDoFo::PdfData::GetBuffer ( ) const
inline

Access the data as a std::string

Returns
a const reference to the contained data

◆ Write()

void PdfData::Write ( OutputStream & stream,
PdfWriteFlags writeMode,
const PdfStatefulEncrypt & encrypt,
charbuff & buffer ) const
overridevirtual

Write the complete datatype to a file.

Parameters
devicewrite the object to this device
writeModeadditional options for writing this object
encryptan encryption object which is used to encrypt this object or nullptr to not encrypt this object

Implements PoDoFo::PdfDataProvider.