Im using prawn to generate a PDF output in a rails app. How do i change the color of the outputted text?
+6
A:
Have you tried fill_color?
require "rubygems"
require "prawn"
Prawn::Document.generate "hello.pdf" do
fill_color "0000ff"
text "Hello World (in blue)", :at => [200,720], :size => 32
end
The MYYN
2010-01-07 10:28:51
A:
Note that you can also set a CMYK color (in this example 100% key black):
fill_color(0,0,0,100)
gawin
2010-05-27 06:42:18