How do I copy resources (e.g, ColorSpace) between PDF docs?

Q: How do I copy resources (e.g, ColorSpace) between PDF docs?

I need to copy color spaces between 2 docs and use it later for color
conversion. Need a snippet how to copy Color Spaces + extras e.g.
(Alternative Color Spaces ).
----------------------

A: You could use the following line (C#; other languages are along the
same lines):

Obj cs_imp_obj = to_pdf.GetSDFDoc().ImportObj(cs_src.GetSDObj(),
true);
ColorSpace cs_dest = new ColorSpace(cs_imp_obj);

You can use the same technique to copy any other object or resource
between PDFs.