Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
The function activates a device color space in the graphics state.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Value | The new colorspace. Can be DeviceRGB, DeviceCMYK or DeviceGray. | "DeviceGray" |
Returns OK on success or error message.
See also SetColorSpace function in DynaPDF manual.
Set to RGB:
MBS( "DynaPDF.SetColorSpace"; $PDF; "DeviceRGB" )
Set to CMYK:
MBS( "DynaPDF.SetColorSpace"; $PDF; "DeviceCMYK" )
Write in CMYK:
# switch to CMYK
Set Variable [$r; Value:MBS( "DynaPDF.SetColorSpace"; $pdf; "DeviceCMYK" )]
# set color to Cyan
Set Variable [$r; Value:MBS("DynaPDF.SetFillColor"; $pdf; 1; 0; 0; 0)]
# Write some text
Set Variable [$r; Value:MBS("DynaPDF.WriteText"; $pdf; 100; $x; "Some cyan text")]
# now switch back to RGB
Set Variable [$r; Value:MBS( "DynaPDF.SetColorSpace"; $pdf; "DeviceRGB" )]
This function checks for a license.
Created 18th August 2014, last changed 12nd November 2018