PoDoFo
0.9.6
|
#include <PdfOutputDevice.h>
Public Member Functions | |
PdfOutputDevice () | |
PdfOutputDevice (const char *pszFilename, bool bTruncate=true) | |
PdfOutputDevice (char *pBuffer, size_t lLen) | |
PdfOutputDevice (const std::ostream *pOutStream) | |
PdfOutputDevice (PdfRefCountedBuffer *pOutBuffer) | |
PdfOutputDevice (std::iostream *pStream) | |
virtual | ~PdfOutputDevice () |
virtual size_t | GetLength () const |
virtual void | Print (const char *pszFormat,...) |
virtual void | PrintV (const char *pszFormat, long lBytes, va_list argptr) |
long | PrintVLen (const char *pszFormat, va_list args) |
virtual void | Write (const char *pBuffer, size_t lLen) |
virtual size_t | Read (char *pBuffer, size_t lLen) |
virtual void | Seek (size_t offset) |
virtual size_t | Tell () const |
virtual void | Flush () |
This class provides an output device which operates either on a file or on a buffer in memory. Additionally it can count the bytes written to the device.
This class is suitable for inheritance to provide output devices of your own for PoDoFo. Just override the required virtual methods.
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | ) |
Construct a new PdfOutputDevice that does not write any data. Only the length of the data is counted.
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | const char * | pszFilename, |
bool | bTruncate = true |
||
) |
Construct a new PdfOutputDevice that writes all data to a file.
pszFilename | path to a file that will be opened and all data is written to this file. |
bTruncate | whether to truncate the file after open. This is useful for incremental updates, to not truncate the file when writing to the same file as the loaded. Default is true. |
When the bTruncate is false, the device is automatically positioned to the end of the file.
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | char * | pBuffer, |
size_t | lLen | ||
) |
Construct a new PdfOutputDevice that writes all data to a memory buffer. The buffer will not be owned by this object and has to be allocated before.
pBuffer | a buffer in memory |
lLen | the length of the buffer in memory |
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | const std::ostream * | pOutStream | ) |
Construct a new PdfOutputDevice that writes all data to a std::ostream.
WARNING: PoDoFo will change the stream's locale. It will be restored when the PdfOutputStream controlling the stream is destroyed.
pOutStream | write to this std::ostream |
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | PdfRefCountedBuffer * | pOutBuffer | ) |
Construct a new PdfOutputDevice that writes all data to a PdfRefCountedBuffer. This output device has the advantage that the PdfRefCountedBuffer will resize itself if more memory is needed to hold all data.
pOutBuffer | write to this PdfRefCountedBuffer |
PoDoFo::PdfOutputDevice::PdfOutputDevice | ( | std::iostream * | pStream | ) |
Construct a new PdfOutputDevice that writes all data to a std::iostream and reads from it as well.
WARNING: PoDoFo will change the stream's locale. It will be restored when the PdfOutputStream controlling the stream is destroyed.
pStream | read/write from/to this std::iostream |
|
virtual |
Destruct the PdfOutputDevice object and close any open files.
|
virtual |
Flush the output files buffer to disk if this devices operates on a disk.
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
inlinevirtual |
The number of bytes written to this object.
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
virtual |
Write to the PdfOutputDevice. Usage is as the usage of printf.
WARNING: Do not use this for doubles or floating point values as the output might depend on the current locale.
pszFormat | a format string as you would use it with printf |
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
virtual |
Write to the PdfOutputDevice. Usage is as the usage of printf.
WARNING: Do not use this for doubles or floating point values as the output might depend on the current locale.
pszFormat | a format string as you would use it with printf |
lBytes | length of the format string in bytes when written |
argptr | variable argument list |
long PoDoFo::PdfOutputDevice::PrintVLen | ( | const char * | pszFormat, |
va_list | args | ||
) |
Determine the length of a format string in bytes when written using PrintV
pszFormat | format string |
args | variable argument list |
|
virtual |
Read data from the device
pBuffer | a pointer to the data buffer |
lLen | length of the output buffer |
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
virtual |
Seek the device to the position offset from the beginning
offset | from the beginning of the file |
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
inlinevirtual |
Get the current offset from the beginning of the file.
Reimplemented in PoDoFo::PdfSignOutputDevice.
|
virtual |
Write data to the buffer. Use this call instead of Print if you want to write binary data to the PdfOutputDevice.
pBuffer | a pointer to the data buffer |
lLen | write lLen bytes of pBuffer to the PdfOutputDevice |
Reimplemented in PoDoFo::PdfSignOutputDevice.