Can I color convert existing PDF documents (e.g. RGB PDF to CMYK PDF) using PDFNet?

199 views
Skip to first unread message

Support

unread,
Dec 19, 2007, 2:50:39 PM12/19/07
to PDFTron PDFNet SDK
Q: What I have is a pdf coming in, with any number of colorspaces, and
I want to be able to specify certain objects (i.e. this and that
image, certain text) to be converted to either CMYK or a spot color.
Is this possible with your tool? Is it possible to map object color in
any way?

----
A: You can implement this functionality using PDFNet SDK
(www.pdftron.com/net).

As a starting point you may want to take a look at ElementEdit sample
project:
ElementEdit: http://www.pdftron.com/net/samplecode.html#ElementEdit

"The sample code shows how to edit the page display list and how to
modify graphics state attributes on existing Elements. In particular
the sample program strips all images from the page and changes text
color to blue."

In a similar fashion you can change a color space associated with text
or a path (element.GetGState().SetFillColorSpace(...) etc).

Also you can replace embedded RGB images with CMYK equivalents. To
find more information on this topic, you can search for "replace
images" or "ElementEdit" in PDFNet Knowledge Base:
http://groups.google.com/group/pdfnet-sdk

Regarding color conversion, PDFNet comes with some utility methods to
map color points from one color space to another. For example, in
pdftron.PDF.ColorSpace class there are methods such as ConvertToRGB(),
ConvertToCMYK(), and ConvertToGray() that will allow you to convert
colors from any color space (e.g. DeviceN, Separation, Indexed, RGB,
CMYK, CIE, Gray, etc) to the target color space. If this is not
enough, you are also free to choose between ICM, ColorSync, or a third
party color library to implement color conversion.
Reply all
Reply to author
Forward
0 new messages