Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 625

Previous Page 624   Index   Next Page 626

Function Reference
Page 625 of 750
The function sets the compression filter which is used to compress images. The filters are described
in detail at InsertImage().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetCompressionLevel
Syntax:
LBOOL pdfSetCompressionLevel(
const PPDF* IPDF,
// Instance pointer
TCompressionLevel CompressLevel) // see below
typedef enum
{
clNone
= 0, // No compression (ignored for images)
clDefault = 1, // Normal compression ratio
clFastest = 2, // Less compression ratio but faster
clMax
= 3
// Maximum compression ratio but slow
}TCompressionLevel;
The function sets the current compression level. If the compression level is clNone, content streams
will be left uncompressed. This value is useful if a content stream must be debugged, the value will
be ignored for image streams. The compression level is also used by certain image compression
filters, see InsertImage() for further information.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetContent
Syntax:
LBOOL pdfSetContent(
const PPDF* IPDF,
// Instance pointer
const char* Buffer, // New content stream
UI32 BufSize)
// Buffer size in bytes
This function replaces the content stream of the currently open page or template with a new one. If
the parameter Buffer is NULL the content stream of the page or template will be deleted. In the latter
case page resources such as fonts, images and so on will be deleted from the page object too.
Remarks:
Use this function in combination with GetContent() if you need to change a content stream in a
manner that DynaPDF does not supports. Do never change a content stream when you don't know
exactly what you are doing.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: SetCompressionFilter

Next topic: SetDefBitsPerPixel