cpdf_setrgbcolor_stroke

(PHP 3 >= 3.0.8, PHP 4, PHP 5 <= 5.0.4)

cpdf_setrgbcolor_stroke -- Sets drawing color to rgb color value

Description

bool cpdf_setrgbcolor_stroke ( int pdf_document, float red_value, float green_value, float blue_value )

The cpdf_setrgbcolor_stroke() function sets the current drawing color to the given rgb color value. 如果成功则返回 TRUE,失败则返回 FALSE

注: The values are expected to be floating point values between 0.0 and 1.0. (i.e black is (0.0, 0.0, 0.0) and white is (1.0, 1.0, 1.0)).

See also cpdf_setrgbcolor_fill() and cpdf_setrgbcolor().


add a note add a note User Contributed Notes
xerofun at gmx dot li
15-Aug-2003 02:46
You have to set the color as a floating point value. So for white you can't use the values 255, 255, 255 (for red, green and blue) as you would do in a normal graphics program, you would have to enter 1.0, 1.0, 1.0 .

So black would be 0.0, 0.0, 0.0.

Effectively all other colors are in between 0.0 and 1.0.