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:
11.0
11.1
11.2
11.3
11.4
11.5
12.0
12.1
12.2
12.3
Statistic
FMM
Blog
DynaPDF.SetFillColor
The function sets the current fill color as an array of float values.
Component | Version | macOS | Windows | Linux | Server | iOS SDK | License |
DynaPDF | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | Paid |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Value... | The values for the colors. | 0 |
Result
Returns OK or error message.
Description
The function sets the current fill color as an array of float values.The components of non-Lab color spaces must be in the range from 0 through 1. The *a and *b components of a Lab color space are typically in a range from -128 though 127. The *L component ranges from 0 through 100.
The number of components must match the number of components of the underlying color space. You can add an alpha value on the end.
For a grayscale color, please pass 3 times the gray level for a RGB color.
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Value parameter as often as you need.
See also SetFillColor function in DynaPDF manual.
Examples
Sets color to red:
MBS( "DynaPDF.SetFillColor"; $PDF; 1.0; 0.0; 0.0 )
Sets color to blue:
MBS( "DynaPDF.SetFillColor"; $PDF; 0.0; 0.0; 1.0 )
Sets color to middle level gray:
MBS( "DynaPDF.SetFillColor"; $PDF; 0.5; 0.5; 0.5 )
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" )]
Draw line in a separation color:
# draw line in Cut Color
Set Variable [ $cs ; Value: MBS("DynaPDF.CreateSeparationCS"; $pdf; "Through Cut"; "DeviceCMYK"; -1; MBS("DynaPDF.CMYK"; 0; 255; 0; 0)) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetExtColorSpace"; $pdf; $cs) ]
Set Variable [ $r ; Value: MBS("DynaPDF.SetFillColor"; $pdf; 1) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Rectangle"; $pdf; $x; $y; $w; $h; "Stroke" ) ]
Set RGB color:
# Red 247 Green 162 Blue 53
MBS( "DynaPDF.SetFillColor"; $PDF; 247/255; 162/255; 53/255 )
Set color to white for RGB:
MBS( "DynaPDF.SetFillColor"; $PDF; 1.0; 1.0; 1.0 )
Set color with integer values in range of 0 to 255:
MBS( "DynaPDF.SetFillColor"; $PDF; $red / 255.0; $green / 255.0; /blue / 255.0 )
See also
- DynaPDF.GetFieldColor
- DynaPDF.SetExtColorSpace
- DynaPDF.SetFieldBBox
- DynaPDF.SetFieldColor
- DynaPDF.SetStrokeColor
- DynaPDF.Triangle
- DynaPDF.WriteFText
- DynaPDF.WriteStyledText
- DynaPDF.WriteStyledTextEx
- DynaPDF.WriteText
Release notes
- Version 11.0
- Added DynaPDF.SetFillColorValue and DynaPDF.SetStrokeColorValue functions.
Example Databases
- Barcode/DynaPDF Barcode
- Barcode/QRCode PDF
- DynaPDF/Create PDF with Bezier Curves
- DynaPDF/Live Styled Text
- DynaPDF/Multi Column Output
- DynaPDF/Picture to PDF with navigation
- DynaPDF/Picture to PDF
- DynaPDF/Place Picture
- DynaPDF/Styled Text
- DynaPDF/WriteFText
FileMaker Magazin
Created 18th August 2014, last changed 5th June 2021
DynaPDF.SetFieldToolTip - DynaPDF.SetFillColorValue
Feedback: Report problem or ask question.
