convertPageToDeviceNImageWithAlpha
Convert a page to a DeviceN image with an alpha channel.
convertPageToDeviceNImageWithAlpha([in] int page, [in] double dpi)
This function rasterizes a page in DeviceN mode, i.e., with separate
color channels for each process color (cyan, magenta, yellow, and
black), and for each custom (a.k.a., spot) color.
This function differs from convertPageToDeviceNImage
in that it
skips the final page compositing step, and maintains an alpha bitmap.
The alpha bitmap can be retrieved with getDeviceNAlphaPicture
.
Note: The alpha bitmap is only useful with PDF files that have been constructed with a transparent background.
After calling convertPageToDeviceNImageWithAlpha
:
- call
getNumDeviceNChannels
to retrieve the number of color channels - call
getDeviceNChannelName
andgetDeviceNChannelCMYK
to get the name and CMYK value for a particular channel - call
getDeviceNPicture
to get a bitmap for a particular channel - call
getDeviceNAlphaPicture
to get the alpha channel bitmap
clearDeviceNImage
to release the memory used by
convertPageToDeviceNImageWithAlpha
.
To enable an overprint preview rasterization, call setConfig
to
set the overprintPreview
parameter before
calling convertPageToDeviceNImage
:
pdf.setConfig "overprintPreview yes"
VB:
rast.convertPageToDeviceNImageWithAlpha(page, dpi)
nChannels = rast.getNumDeviceNChannels()
For i = 0 To nChannels-1
channelName = rast.getDeviceNChannelName(i)
channelCMYK = rast.getDeviceNChannelCMYK(i)
pic = rast.getDeviceNPicture(i)
' each channel has an 8-bit grayscale bitmap, similar to what
' is returned by convertPageToPicture in imageGray mode
...
Next i
pic = rast.getDeviceNAlphaPicture()
' the returned image is similar to the color channel images
...
rast.clearDeviceNImage()