Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.CMYK

Calculates color value for CMYK.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 4.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.CMYK"; Cyan; Magenta; Yellow; Black )   More

Parameters

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

Result

Returns color value as number.

Description

Calculates color value for CMYK.
For use with functions which take a color as a big number.
Calculation is Cyan * 16777216 + Magenta * 65536 + Yellow * 256 + Black.
Use it only if the color space is CMYK.

Examples

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" ) ]

See also

Example Databases

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 3th March 2022


DynaPDF.Bezier23 - DynaPDF.ChangeAnnotName