DynaPDF Manual - Page 255

Previous Page 254   Index   Next Page 256

Function Reference
Page 255 of 839
SI32 pdfCreateDeviceNColorSpace(
const PPDF* IPDF,
// Instance pointer
const char** Colorants,
// Array of colorant names (required)
UI32 NumColorants,
// Number of colorants in the array
const char* PostScriptFunc, // Postscript calculator function
TExtColorSpace Alternate,
// Alternate color space
SI32 Handle)
// Handle of the alternate color space or -
The function creates a DeviceN color space. DeviceN color spaces (PDF 1.3) can contain up to 32
color components. They provide greater flexibility than is possible with standard device color spaces
such as DeviceCMYK or with individual Separation color spaces. For example, it is possible to create
a DeviceN color space consisting of only the cyan, magenta, and yellow color components, with the
black component excluded.
Colors of a DeviceN color space are always treated as subtractive colors, even if the device produces
output for the designated component by an additive method. Thus, a tint value of 0 denotes the
lightest color that can be achieved with the given colorant and 255 the darkest. This convention is
the same one as for DeviceCMYK color components but opposite to the one for DeviceGray or
DeviceN was designed to represent color spaces containing multiple components that correspond to
colorants of some target device. As with Separation color spaces, PDF consumer applications must
be able to approximate the colorants if they are not available on the current output device, such as a
display. To accomplish this, the color space definition provides a tint transformation function that
can be used to convert all the components to an alternate color space.
The tint transformation function consists of a PostScript calculator function that is called with n tint
values and returns m color component values, where n is the number of components needed to
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.

Previous topic: CreateComboBox

Next topic: Encoding of Colorant Names, DeviceN Attributes, Spot colorant attributes, Process colorant attributes