Type Default Value Read Only Description
Long   0 No The current ColorSpace ID.




This property determines the current color space.

The ColorSpace is used when the Color is of a matching type. If the color type does not match, then the default - device - color space is used.

For example, you add a CMYK color space and assign it to the ColorSpace property. All CMYK Colors you use will be defined in terms of this color space. However, RGB and Grayscale colors will continue to be defined in terms of the default - device - color spaces.

To get a ColorSpace ID, you need to add your color space to the current document using the AddColorSpaceFile or AddColorSpaceSpot method.




The following code shows how to colorize an image. It adds a base image to the current page and converts it to grayscale. Then it creates a new spot color space and assigns the new color space to the image.

Set theDoc = Server.CreateObject("ABCpdf10.Doc")
theDoc.Rect.Inset 20, 20

Set theImg = Server.CreateObject("ABCpdf10.Image")
theImg.SetFile "c:\mypics\mypic.jpg"
theID = theDoc.AddImageObject(theImg, False)

theID = theDoc.GetInfo(theID, "XObject")
theDoc.SetInfo theID, "Grayscale", ""

theCS = theDoc.AddColorSpaceSpot("MAGENTA", "0 100 0 0")
theDoc.SetInfo theID, "/ColorSpace:Ref", theCS

theDoc.Save "c:\mypdfs\doccolorspace.pdf"