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
Calculates color value for CMYK.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 4.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Cyan | The cyan color component from 0 to 255. | 0 |
Magenta | The magenta color component from 0 to 255. | 0 |
Yellow | The yellow color component from 0 to 255. | 255 |
Black | The black color component from 0 to 255. | 255 |
Returns color value as number.
Get a black color value:
MBS( "DynaPDF.CMYK"; 0; 0; 0; 255 )
Write text in CMYK colors:
# set colorspace
Set Variable [ $r ; Value: MBS("DynaPDF.SetColorSpace"; $pdf; "DeviceCMYK") ]
# calculate color values for CMYK
Set Variable [ $cyan ; Value: MBS( "DynaPDF.CMYK"; 255; 0; 0; 0 ) ]
Set Variable [ $magenta ; Value: MBS( "DynaPDF.CMYK"; 0; 255; 0; 0 ) ]
Set Variable [ $yellow ; Value: MBS( "DynaPDF.CMYK"; 0; 0; 255; 0 ) ]
Set Variable [ $black ; Value: MBS( "DynaPDF.CMYK"; 0; 0; 0; 255 ) ]
# now write some text
Set Variable [ $r ; Value: MBS("DynaPDF.SetTextRect"; $pdf; 100; 100; 500; 200) ]
Set Variable [ $r ; Value: MBS("DynaPDF.WriteFText"; $pdf; "left"; "Testing: " &
"\FC[" & $cyan & "]Cyan" &
"\FC[" & $Magenta & "]Magenta" &
"\FC[" & $Yellow & "]Yellow" &
"\FC[" & $Black & "]Black" ) ]
This function is free to use.
Created 18th August 2014, last changed 3th March 2022