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

DynaPDF Manual - Page 225

Previous Page 224   Index   Next Page 226

Function Reference
Page 225 of 750
specify a color in the DeviceN color space and m is the number of components required by the
alternate color space.
Note: Painting in the alternate color space may produce a good approximation of the intended color
when only opaque objects are painted. However, it does not correctly represent the interactions
between an object and its backdrop when the object is painted with transparency or when
overprinting is enabled (see also CreateExtGState()).
A DeviceN color space supports the special colorant name None which produces no visible output on
the device. When a DeviceN color space is painting the named device colorants directly, color
components corresponding to None colorants are discarded. However, when the DeviceN color space
reverts to its alternate color space, those components are passed to the tint transformation function,
which can use them as desired.
Note: A DeviceN color space whose component colorant names are all None always discards its
output, just the same as a Separation color space for None; it never reverts to the alternate color
space. Reversion occurs only if at least one color component (other than None) is specified and is not
available on the device.
Encoding of Colorant Names
Colorant names are interpreted in the code page 1252 by default. Because colorant names are stored
in UTF-8 Unicode format in PDF, it is also possible to pass UTF-8 encoded Unicode strings to the
function. However, the function must be able to distinguish between both string formats. To achieve
this, the parameter NumColorants accepts the special flag 0x10000000 that specifies that the Colorants
array contains UTF-8 encoded strings. The flag must be combined with the number of colorants with
a binary or operator:
numColorants |= 0x10000000;
// C/C++, C#
= numColorants Or &H10000000 // Visual Basic
numColorants := numColorants or $10000000
// Delphi
DeviceN Attributes
DeviceN and NChannel color spaces can contain optional attributes describing further characteristics
of the color space. The most important attributes are the definitions of the spot and process colorants
which are used by the color space. These attributes are required to enable certain features in a viewer
application, e.g. the Output Preview in Adobe's Acrobat depends on it.
Notice: Although the definition of spot and process colorants is optional, it is bad practice to create a
DeviceN color space without this information.
Spot colorant attributes
Spot colorants can be defined as normal Separation color spaces and then added as an attribute to
the color space with AddDeviceNSeparations(). The advantage is that the alternate color space and
tint transformation function of the Separation color space describe the appearance of that colorant
alone, whereas those of a DeviceN color space describe only the appearance of its colorants in

Previous topic: CreateDeviceNColorSpace

Next topic: How to create the PostScript Calculator Function?