DynaPDF Manual - Page 256

Previous Page 255   Index   Next Page 257

Function Reference
Page 256 of 839
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
combination. The definition of the spot colorants is optional but strongly recommended because it is
the only way to render a spot colorant alone. Note that the Output Preview in Adobe's Acrobat
depends on properly defined spot colorants.
Process colorant attributes
If a DeviceN color space contains components of a process color space then it should include
information about the color space in which these components are defined. This can be done with the
function AddDeviceNProcessColorants() which accepts an array of colorant names and the
underlying process color space. The process color space can be any device or CIE based color space.
If an ICCBased color space is specified, it must provide calibration information appropriate for the
process color components specified in the names array of the DeviceN color space.

Previous topic: CreateDeviceNColorSpace

Next topic: How to create the PostScript Calculator Function?