Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 346

Previous Page 345   Index   Next Page 347

Function Reference
Page 346 of 767
The function returns the standard compression filter for images. Note that 1 bit images are always
compressed with Flate.
GetCompressionLevel
Syntax:
SI32 pdfGetCompressionLevel(
const PPDF* IPDF) // Instance pointer
typedef enum
{
clNone
= 0,
clDefault = 1,
clFastest = 2,
clMax
= 3
}TCompressionLevel;
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()).
GetContent
Syntax:
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
damaged.
Remarks:
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.
 

Previous topic: GetContent

Next topic: GetDocInfo