Converting XAML and WPF reports with CMYK to PDF

Q:

I am using PDFNet to generate PDF from XAML reports (http://msdn.microsoft.com/en-us/library/ms752059.aspx) as shown in you Xaml2Pdf sample: http://www.pdftron.com/pdfnet/samplecode.html#Xaml2Pdf

I now need to specify CMYK colour. How can we specify the CMYK colours on XAML files?

A:

You can use CMYK directly in XAML:

The way that WPF uses colour models is by System.Windows.Media.Color's static constructor FromValues() and introducing a colour profile:

The following code, for example:

var c = Color.FromValues( 
               new float[] {1.0f,0.0f,0.0f,0.0f } ,  
               new Uri("file://C:/ICCProfile.icc",  UriKind.Absolute)); 

creates a 100% Cyan colour.