DynaPDF.CreateSeparationCS
--------------------------

Creates a Separation color space.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [7.4](newinversion74.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.CreateSeparationCS"; PDF; Colorant; Alternate; Handle; Color ) 

**MBS**( **"DynaPDF.CreateSeparationCS";** /\* Creates a Separation color space. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Colorant**; /\* Colorant name. Required.e.g. "Pantone" \*/   
**$Alternate**; /\* The alternate color space.  
Can be DeviceRGB, DeviceCMYK, DeviceGray, CalGray, CalRGB, Lab, ICCBased, Pattern, Indexed, Separation, DeviceN, NChannel or the machting number value.e.g. "DeviceCMYK" \*/   
**$Handle**; /\* Alternate color space handle or -1. \*/   
**$Color**) /\* Color value defined in the alt. color space. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Colorant | Colorant name. Required. | "Pantone" |
| Alternate | The alternate color space.   Can be DeviceRGB, DeviceCMYK, DeviceGray, CalGray, CalRGB, Lab, ICCBased, Pattern, Indexed, Separation, DeviceN, NChannel or the machting number value. | "DeviceCMYK" |
| Handle | Alternate color space handle or -1. |  |
| Color | Color value defined in the alt. color space. |  |

### Result

Returns color space handle or error.

### Description

Creates a Separation color space.   
Color output devices produce full color by combining primary or process colorants in varying amounts. On an additive color device such as a display, the primary colorants consist of red, green, and blue phosphors; on a subtractive device such as a printer, they typically consist of cyan, magenta, yellow, and sometimes black inks. In addition, some devices can apply special colorants, often called spot colorants, to produce effects that cannot be achieved with the standard process colorants alone. Examples include metallic and fluorescent colors and special textures.   
When printing a page, most devices produce a single composite page on which all process colorants (and spot colorants, if any) are combined. However, some devices, such as imagesetters, produce a separate, monochromatic rendition of the page, called a separation, for each colorant. When the separations are later combined-on a printing press, for example-and the proper inks or other colorants are applied to them, the result is a full-color page.   
A Separation color space (PDF 1.2) provides a means for specifying the use of additional colorants or for isolating the control of individual color components of a device color space for a subtractive device. When such a space is the current color space, the current color is a single-component value, called a tint, that controls the application of the given colorant or color components only.   
The parameter Colorant specifies the colorant name which this Separation color space is intended to represent. The special colorant name All refers collectively to all colorants available on an output device, including those for the standard process colorants. When a Separation space with this colorant name is the current color space, painting operators apply tint values to all available colorants at once. This is useful for purposes such as painting registration targets in the same place on every separation.   
Such marks are typically painted as the last step in composing a page to ensure that they are not overwritten by subsequent painting operations.   
The special colorant name None never produces any visible output. Painting operations in a Separation space with this colorant name have no effect on the current page.   
The parameter Alternate specifies the alternate color space in which the color should be rendered if the device does not support the specified colorant. The alternate color space can be any Device or CIE based color space but not in turn a special color space like Separation, Indexed, or DeviceN.   
The parameter Handle specifies the handle of the alternate color space if a CIE based color space should be used. If the alternate color space is a device color space the parameter Handle is ignored.   
The parameter Color specifies the alternate color value, defined in the alternate color space, which is used if the device does not support the colorant.   
A color value in a Separation color space consists of a single tint component in the range 0 to 255. The value 0 represents the minimum amount of colorant that can be applied; 255 represent the maximum. Tints are always treated as subtractive colors, even if the device produces output for the designated component by an additive method. Thus, a tint value of 0 denotes the lightest color that can be achieved with the given colorant, and 255 is the darkest. This convention is the same as for DeviceCMYK color components but opposite to the one for DeviceGray and DeviceRGB.   
Encoding of Colorant Names   
MBS Plugin uses UTF-8 for colorants names.  
Notice:   
Non-device color spaces cannot be used for interactive objects such as annotations or form fields. The active color space must always be changed to a device color space before creating interactive objects; see [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md). Note also that annotations support DeviceRGB only. Form fields support DeviceGray, DeviceRGB, and DeviceCMYK.   
Remarks:   
Use the function [DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md) to activate the color space in the graphics state. To set a color of a Separation space pass the wished color value to [DynaPDF.SetFillColor](DynaPDFSetFillColor.md), [DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md), or DynaPDF.SetColors.   
Return values:   
If the function succeeds the return value is the color space handle, a value greater or equal zero. If the function fails the return value is an error message.   
See also [CreateSeparationCS](https://www.monkeybreadsoftware.com/DynaPDF-Manual/CreateSeparationCS.shtml) function in DynaPDF manual.

### Examples

Create separation color space:

 # We create also Separation color spaces for the spot colors and add   
\# these color spaces as an attribute to the DeviceN color space:   
Set Variable \[ $separations0 ; Value: MBS ("DynaPDF.CreateSeparationCS"; $pdf ; "Yellow"; "DeviceCMYK"; -1; MBS ("[DynaPDF.CMYK](DynaPDFCMYK.md)"; 0; 0; 87; 0)) \]  
Draw line in a separation color:

 # draw line in Cut Color   
Set Variable \[ $cs ; Value: MBS ("DynaPDF.CreateSeparationCS"; $pdf ; "Through Cut"; "DeviceCMYK"; -1; MBS ("[DynaPDF.CMYK](DynaPDFCMYK.md)"; 0; 255; 0; 0)) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md)"; $pdf ; $cs ) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 1) \]   
Set Variable \[ $r ; Value: MBS ( "[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $pdf ; $x ; $y ; $w ; $h ; "Stroke" ) \]  
### See also

- [DynaPDF.AddDeviceNSeparations](DynaPDFAddDeviceNSeparations.md)
- [DynaPDF.CMYK](DynaPDFCMYK.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.Rectangle](DynaPDFRectangle.md)
- [DynaPDF.SetColorSpace](DynaPDFSetColorSpace.md)
- [DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.md)
- [DynaPDF.SetStrokeColor](DynaPDFSetStrokeColor.md)

### Release notes

- **Version 7.4**
    - Added [DynaPDF.AddDeviceNProcessColorants](http://www.mbsplugins.eu/DynaPDFAddDeviceNProcessColorants.shtml), [DynaPDF.AddDeviceNSeparations](http://www.mbsplugins.eu/DynaPDFAddDeviceNSeparations.shtml), [DynaPDF.CreateDeviceNColorSpace](http://www.mbsplugins.eu/DynaPDFCreateDeviceNColorSpace.shtml), [DynaPDF.CreateSeparationCS](http://www.mbsplugins.eu/DynaPDFCreateSeparationCS.shtml), [DynaPDF.SetExtColorSpace](http://www.mbsplugins.eu/DynaPDFSetExtColorSpace.shtml), [DynaPDF.SetExtFillColorSpace](http://www.mbsplugins.eu/DynaPDFSetExtFillColorSpace.shtml), [DynaPDF.SetExtStrokeColorSpace](http://www.mbsplugins.eu/DynaPDFSetExtStrokeColorSpace.shtml) and [DynaPDF.SetSeparationInfo](http://www.mbsplugins.eu/DynaPDFSetSeparationInfo.shtml) functions.

### Example Databases

- [DynaPDF/Create DeviceN ColorSpace](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20DeviceN%20ColorSpace.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.4pr4](https://www.mbsplugins.de/archive/2017-08-31/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th August 2017 , last changed 11st November 2018

  
[DynaPDF.CreateResetAction](DynaPDFCreateResetAction.md) - [DynaPDF.CreateSigField](DynaPDFCreateSigField.md)

[HTML Version](DynaPDFCreateSeparationCS.shtml)