DynaPDF Manual - Page 605

Previous Page 604   Index   Next Page 606

Function Reference
Page 605 of 770
SI32 pdfReplaceICCProfileEx(
const PPDF* IPDF,
// Instance pointer
UI32 ColorSpace,
// Color space handle
const void* Buffer, // File buffer of an ICC profile
UI32 BufSize)
// Buffer size in bytes
The function replaces an ICC profile exactly in the same way as ReplaceICCProfile() but accepts a file
buffer as input.
Return values:
If the function succeeds the return value is zero. If the function fails the return value is a negative
error code.
LBOOL pdfReplaceImage(
const PPDF* IPDF,
// Instance pointer
const PIMG* Source,
// Pointer of the image object
const char* Image,
// Path of the new image
UI32 Index,
// The first image is denoted by 1
TExtColorSpace CS,
// Image color space
SI32 CSHandle,
// Color space handle or -1 for device spaces
TReplaceImageFlags Flags) // See below.
typedef enum
= 0,
// Nothing special to do.
rifDeleteAltImages = 1,
// Delete all alternate images if any.
= 2,
// Delete the meta data that was associated with the image.
= 4,
// Delete the Optional Content Group if any. This changes the visibility
// state of the image. Normally the OCG should be left as is.
= 8
// An image can contain a soft mask that acts as an alpha channel. This
// mask can be deleted or left as is. The mask will always be deleted if
// the new image contains an alpha channel.
The function replaces an image with another image.
The parameter Source must be a valid pointer of an image object. This pointer is part of the
TPDFImage structure (member ObjectPtr) which is retrieved by functions like GetImageObj() or
The resolution, aspect ratio, color space and so on can be freely chosen. However, note that this
function does not change the output position or size. If the aspect ratio of the new image is different,
then it will be stretched or shrunk to fit into the output rectangle.
The parameter CS specifies the destination color space into which the image should be converted or
saved, if the image is already defined in that color space. CSHandle must be the handle of that color
space if a non-device space is used. The will be ignored for devices spaces.

Previous topic: ReplaceFontEx, ReplaceICCProfile

Next topic: ReplaceImageEx