DynaPDF.AddDeviceNSeparations
-----------------------------

Adds DeviceN separations.

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

MBS( "DynaPDF.AddDeviceNSeparations"; PDF; DeviceNCS; Colorants; SeparationCS; NumColorants ) 

**MBS**( **"DynaPDF.AddDeviceNSeparations";** /\* Adds DeviceN separations. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$DeviceNCS**; /\* Handle of a DeviceN or NChannel color space. \*/   
**$Colorants**; /\* Array of colorant names. \*/   
**$SeparationCS**; /\* Array of Separation color space handles. \*/   
**$NumColorants**) /\* Number of colorants and handles in the arrays. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| DeviceNCS | Handle of a DeviceN or NChannel color space. |  |
| Colorants | Array of colorant names. |  |
| SeparationCS | Array of Separation color space handles. |  |
| NumColorants | Number of colorants and handles in the arrays. |  |

### Result

Returns OK or error.

### Description

Adds DeviceN separations.  
Adds a dictionary to a DeviceN or NChannel color space that describes the spot colorants which are used in the color space.   
This dictionary provides information about the individual colorants that may be useful to some applications. In particular, the alternate color space and tint transformation function of a Separation color space describe the appearance of that colorant alone, whereas those of a DeviceN color space describe only the appearance of its colorants in combination.   
The array Colorants holds the spot colorant names and the array SeparationCS holds the corresponding Separation color space handles. The colorant names in the array must match the names in the corresponding Separation color spaces. In addition, the colorants must be included in the DeviceN or NChannel color space.   
If NumColorants is zero the functions deletes existing definitions of spot colorants in the DeviceN or NChannel color space. Otherwise, existing definitions will be overridden.   
See also [AddDeviceNSeparations](https://www.monkeybreadsoftware.com/DynaPDF-Manual/AddDeviceNSeparations.shtml) function in DynaPDF manual.

### Examples

Create separation color space with spotcolor and use it:

 # Create the DeviceN color space   
\# Create Blend function (see dynapdf\_help.pdf for how this was created)   
Set Variable \[ $PostScriptFunc ; Value: "{2 index 0.38 mul 2 index 0 add add 0 3 index 0.56 mul 0 add add 4 index 0.34 mul 0 4 index add add 0 0 0 add add 7 4 roll pop pop pop}" \]   
Set Variable \[ $cls ; Value: "PANTONE 345 CVC¶PANTONE 293 CVC¶Yellow" \]   
Set Variable \[ $cs ; Value: MBS ("[DynaPDF.CreateDeviceNColorSpace](DynaPDFCreateDeviceNColorSpace.md)"; $pdf ; $cls ; 3; $PostScriptFunc ; "DeviceCMYK"; -1) \]   
  
\# We create also Separation color spaces for the spot colors and add   
\# these color spaces as an attribute to the DeviceN color space:   
\# First spot color   
Set Variable \[ $separations0 ; Value: MBS ("[DynaPDF.CreateSeparationCS](DynaPDFCreateSeparationCS.md)"; $pdf ; Trim(GetValue ( $cls ; 1 )); "DeviceCMYK"; -1; MBS ("[DynaPDF.CMYK](DynaPDFCMYK.md)"; 97; 0; 87; 0)) \]   
\# Second spot color   
Set Variable \[ $separations1 ; Value: MBS ("[DynaPDF.CreateSeparationCS](DynaPDFCreateSeparationCS.md)"; $pdf ; Trim(GetValue ( $cls ; 2 )); "DeviceCMYK"; -1; MBS ("[DynaPDF.CMYK](DynaPDFCMYK.md)"; 255; 143; 0; 0)) \]   
\# Put in a list:   
Set Variable \[ $separations ; Value: $separations0 &amp; ¶ &amp; $separations1 \]   
\# Add the separation color spaces to the DeviceN color space.   
Set Variable \[ $r ; Value: MBS ("DynaPDF.AddDeviceNSeparations"; $pdf ; $cs ; $cls ; $separations ; 2) \]   
\# Because the DeviceN color space uses a process color we add also   
\# the attributes of the process color space to it. Note that all   
\# colorant names must be defined, also if the DeviceN color space   
\# uses only one component of the process color space.   
Set Variable \[ $pcs ; Value: "Cyan¶Magenta¶Yellow¶Black" \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.AddDeviceNProcessColorants](DynaPDFAddDeviceNProcessColorants.md)"; $pdf ; $cs ; $pcs ; 4; "DeviceCMYK"; -1) \]   
\# The DeviceN color space is now fully created so that we can use it   
\# Set the DeviceN color space   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md)"; $pdf ; $cs ) \]   
\# Draw a rectangle with this color   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.SetFillColor](DynaPDFSetFillColor.md)"; $pdf ; 150/255; 100/255; 100/255) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $pdf ; 50; 690; 200; 100; "fill") \]  
### See also

- [DynaPDF.AddDeviceNProcessColorants](DynaPDFAddDeviceNProcessColorants.md)
- [DynaPDF.CMYK](DynaPDFCMYK.md)
- [DynaPDF.CreateDeviceNColorSpace](DynaPDFCreateDeviceNColorSpace.md)
- [DynaPDF.CreateSeparationCS](DynaPDFCreateSeparationCS.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.Rectangle](DynaPDFRectangle.md)
- [DynaPDF.SetExtColorSpace](DynaPDFSetExtColorSpace.md)
- [DynaPDF.SetFillColor](DynaPDFSetFillColor.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 27th August 2017

  
[DynaPDF.AddDeviceNProcessColorants](DynaPDFAddDeviceNProcessColorants.md) - [DynaPDF.AddFieldToFormAction](DynaPDFAddFieldToFormAction.md)

[HTML Version](DynaPDFAddDeviceNSeparations.shtml)