DynaPDF Manual - Page 611

Previous Page 610   Index   Next Page 612

Function Reference
Page 611 of 777
The function works in the very same way as InsertImageEx() with the following differences:
The color of an image mask cannot be set or changed because this would require changes on
the content stream in which the image is used. An image mask will be created if the image
color depth is 1 bit and if color key masking is enabled (see SetUseTransparency()).
SetUseTransparency() should normally be set to false before calling this function.
The image will never be downscaled, independent of the current resolution, because the size
of the output rectangle is not known.
If the image that should be replaced is a soft mask of another base image, then make sure that the
destination color space is set to esDeviceGray, CalGray, or to a one channel ICC based color space
because a soft mask must not contain more than one color channel.
The flags gfUseImageColorSpace, gfIgnoreICCProfiles, gfRealPassThrough, and gfNoBitmapAlpha
are all supported. See SetGStateFlags() for further information.
This function is implemented in an Ansi and Unicode compatible version. Unicode paths are
converted to UTF-8 on non-Windows operating systems.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
LBOOL pdfReplaceImageEx(
const PPDF* IPDF,
// Instance pointer
const PIMG* Source,
// Pointer of the image object
const void* Buffer,
// Pointer to image buffer
UI32 BufSize,
// Buffer size in bytes
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.
The function replaces an image with a new image exactly like ReplaceImage() but accepts a file
buffer as input. See ReplaceImage() for further information.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: ReplaceICCProfileEx, ReplaceImage

Next topic: ReplacePageText, ReplacePageTextEx