Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the color of a horizontal line in Prawn?

How can I set the color of a horizontal_line in Prawn PDF?

This is what I've got:

horizontal_line 0, 540, :at => line

It seems this is nowhere documented in the manual.

Thanks for any help.

like image 305
Tintin81 Avatar asked Mar 21 '23 15:03

Tintin81


2 Answers

To draw a grey horizontal line you must use stroke_horizontal_rule.

This works:

pdf.stroke_color 'dddddd'
pdf.stroke_horizontal_rule
like image 120
andre1810 Avatar answered Mar 23 '23 06:03

andre1810


If I remember correctly you can use stroke_color to set the color on a line like:

    mypdf.stroke_color "f0ffc1"

or

    mypdf.stroke_color 0,0,0,0 // for CMYK

Hope it helps!

like image 37
Nikolai Manek Avatar answered Mar 23 '23 04:03

Nikolai Manek