How can I can create ICC PDF color space with a given ICC profile?

Q: Can you tell us how to set ICC color space and value? This
particular ICC is CMYK profile.

The closest I can get is the following:
  public static void SetColorManagement(bool enable);
  public static void SetDefaultDeviceCMYKProfile(string icc_filename);
  public static void SetDefaultDeviceRGBProfile(string icc_filename);
A: Using PDFNet you can create ICC color space as follows:

// Assuming C# pseudocode...

// Step 1 embed the ICC profile in the document.
StdFile embed_file = new StdFile(input_path + "my_cmyk.icc",
FilterReader mystm = new FilterReader(embed_file);
Obj icc_stm = pdfdoc.CreateIndirectStream(mystm);

// Step 2 Create ICC color space.
// Set the number of color components in the color space described
// by the ICC profile data. 3 for RGB color space, 4 for CMYK, etc.
icc_stm.PutNumber("N", 3);

// Optional: Specify 'alternate' color space in the ICC stream
icc_stm.PutName("Alternate", "DeviceRGB");

Obj icc_cs = pdfdoc.CreateIndirectArray();

// Now use the color space...
// Create a high-level color space....
ColorSpace cs = new ColorSpace(icc_cs);
element.GetGState().SetFillColor(new ColorPt(1, 0, 0, 0)); // cyan


Regarding PDFNet.SetColorManagement(bool enable),
PDFNet.SetDefaultDeviceCMYKProfile(), and
PDFNet.SetDefaultDeviceRGBProfile() these functions are used to
control color conversion during PDF processing (the input side) and
they do not have any effect if you are only creating new color spaces
and new content.