DynaPDF Manual - Page 383

Previous Page 382   Index   Next Page 384

Function Reference
Page 383 of 839
SI32 pdfGetCompressionLevel(
const PPDF* IPDF) // Instance pointer
typedef enum
= 0,
clDefault = 1,
clFastest = 2,
= 3
The function returns the active compression level. JPEG images are compressed with optimized
Huffmann tables if the compression level is clMax. This results in 5% to 10% better compression
ratio without losing quality. The compression level can also be used to switch the compression
mode to real or integer when using the JPEG2000 compression filter (see also InsertImage()).
SI32 pdfGetContent(
const PPDF* IPDF,
// Instance pointer
char* ADDR BufSize) // Buffer
This function returns a pointer to the content stream of the currently open page or template. The
parameter BufSize gets the buffer size in bytes; this parameter must not be set to NULL.
The page or template must be open with EditPage() or EditTemplate() beforehand.
When no further objects must be added it is possible to edit the buffer directly to improve
processing speed. However, when changing the buffer size it is highly recommended to update the
content stream with the function SetContent().
When new contents must be added, copy the buffer into a new one and replace the content stream
with SetContent() when finished. Do not change a content stream when you don't know exactly
what you are doing. If the content stream contains invalid operators after editing the PDF file will be
The function returns a pointer to the original content buffer of the currently open page or template.
DynaPDF is the owner of this buffer, it must not be freed in you application.
Return values:
If the function succeeds the return value is the buffer size if bytes. If the function fails the return
value is a negative error code.

Previous topic: GetColorSpaceObjEx, GetCompressionFilter

Next topic: GetDefBitsPerPixel, GetDescent