LONG AddColorSpace ( BSTR colorspaceFile ) |
This method loads an ICC profile from a file colorspaceFile into a PDF document and returns the index of the profile. This index can be used later with color-related methods. Supported ICC profile types: RGB, CMYK.
The returned value can be used in SetColorSpace.
{ PDF object is supposed to be created } PDF.SetLicenseData('demo', 'demo'); PDF.SetColorFill(1, 0, 0.5, 0); //this is standart RGB color PDF.DrawRectangle(10, 10, 100, 100, 0); PDF.Fill; profile := PDF.AddColorSpace('path\to\AppleRGB.icc'); PDF.SetColorSpace(profile); PDF.SetColorFill(1, 0, 0.5, 0); //this is a color from profile PDF.DrawRectangle(130, 10, 100, 100, 0); PDF.Fill; PDF.SaveToFile('test.pdf', true);
// PDF object is supposed to be created PDF->SetLicenseData("demo", "demo"); PDF->SetColorFill(1f, 0f, 0.5f, 0f); //this is standart RGB color PDF->DrawRectangle(10, 10, 100, 100, 0); PDF->Fill(); long profile = PDF->AddColorSpace("path\\to\\AppleRGB.icc"); PDF->SetColorSpace(profile); PDF->SetColorFill(1f, 0f, 0.5f, 0f); //this is a color from profile PDF->DrawRectangle(130, 10, 100, 100, 0); PDF->Fill(); PDF->SaveToFile("test.pdf", true);
// PDF object is supposed to be created PDF.SetLicenseData("demo", "demo"); PDF.SetColorFill(1f, 0f, 0.5f, 0f); //this is standart RGB color PDF.DrawRectangle(10, 10, 100, 100, 0); PDF.Fill(); long profile = PDF.AddColorSpace(@"path\to\AppleRGB.icc"); PDF.SetColorSpace(profile); PDF.SetColorFill(1f, 0f, 0.5f, 0f); //this is a color from profile PDF.DrawRectangle(130, 10, 100, 100, 0); PDF.Fill(); PDF.SaveToFile("test.pdf", true);
' PDF object is supposed to be created PDF.SetLicenseData "demo", "demo" PDF.SetColorFill 1, 0, 0.5, 0 'this is standart RGB color PDF.DrawRectangle 10, 10, 100, 100, 0 PDF.Fill profile = PDF.AddColorSpace("path\to\AppleRGB.icc") PDF.SetColorSpace profile PDF.SetColorFill 1, 0, 0.5, 0 'this is a color from profile PDF.DrawRectangle 130, 10, 100, 100, 0 PDF.Fill PDF.SaveToFile "test.pdf", true