How can i convert a CMYK image to CMY

Can I please get a sample code in .Net to convert a CMYK image to CMY.

Great question.

The PDF format specifically mentions CMY as one of the uses for the DeviceN colorspace. See Example 1 in Section here:

This forum post shows how to create a DeviceN colorspace.

Then you would create a new Image object, using one of the Image.Create methods, and then modify it to contain your custom data.Then, set the ColorSpace of the Image object to your DeviceN one.

Finally swapping the old image for the new, assuming the old image is not inline (inline images are rare), is trivial.

Note, our Windows SDK includes a tool called COSEdit that you can use to see the internal contents of the PDF.