Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
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