Converting XAML and WPF reports with CMYK to PDF


I am using PDFNet to generate PDF from XAML reports ( as shown in you Xaml2Pdf sample:

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


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.