Mac OS X
Components Crossplatform Mac & Win Server Client Old Guides Examples
New in version: 7.3 7.4 7.5 8.0 8.1 8.2 8.3 8.4 8.5 9.0 Statistic
Replaces an image with another image.
|Component||Version||macOS||Windows||Server||FileMaker Cloud||FileMaker iOS SDK|
|The PDF reference returned from DynaPDF.New.|
|ImageIndex||The index of the image to replace.
From 0 to DynaPDF.GetImageCount-1.
|Image||The new image.
Can be container or native file path.
The index of the image.
This is for a multi picture tiff file to pick the image.
Default is 1 for first image.
The color space to use.
Can be DeviceRGB, DeviceCMYK, DeviceGray, CalGray, CalRGB, Lab, ICCBased, Pattern, Indexed, Separation, DeviceN or NChannel.
Default is DeviceRGB.
The color space handle.
Can be empty if you want to use device colorspace.
Can be number or text with various flags.
Can be set to DeleteAltImages, DeleteMetadata, DeleteOCG and/or DeleteSoftMask.
Returns OK or error.
DescriptionReplaces an image with another image.
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 shrunken 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.
The function works in the very same way as DynaPDF.InsertImage 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 DeviceGray, CalGray, or to a one channel ICC based color space because a soft mask must not contain more than one color channel. The flags UseImageColorSpace, IgnoreICCProfiles, RealPassThrough, and NoBitmapAlpha are all supported. See DynaPDF.SetGStateFlags for further information.
See also ReplaceImage function in DynaPDF manual.
Created 30th September 2017, last changed 30th September 2017
Feedback: Report problem or ask question.
MBS Xojo Plugins