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


Sets a specific color of an interactive form field.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 4.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.SetFieldColor"; PDF; Field; ColorType; CS; Color )   More


Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
Field The field index or field name. "FirstName"
ColorType The type of color. Can be BackColor, BorderColor or TextColor. "TextColor"
CS The color space. Can be DeviceRGB, DeviceCMYK or DeviceGray. "DeviceRGB"
Color The color value to use. MBS( "DynaPDF.RGB"; 0; 0; 255 )


Returns OK or error.


Sets a specific color of an interactive form field.
The background and border color of a form field must be defined in the same color space. The color space for the text color can be defined in a separate color space (e.g. DeviceGray for the text and DeviceRGB for the background and border).
If the border or background should appear transparent set the value to NO_COLOR (4294967281). The text color cannot be transparent.

You can use DynaPDF.RGB function to calculate RGB color value.

See also SetFieldColor function in DynaPDF manual.


Set color to red for field:

Set Variable [ $r; Value: MBS("DynaPDF.SetFieldColor"; $pdf; "CompanyName"; "TextColor"; "DeviceRGB"; MBS( "DynaPDF.RGB"; 255; 0; 0 )) ]

See also

Example Databases

This function checks for a license.

Created 18th August 2014, last changed 30th March 2021

DynaPDF.SetFieldBorderWidth - DynaPDF.SetFieldDate