ruby on rails - How do I set the font size in a prawn table? -


how set font size in pdf table using prawn gem?

when call prawn following:

pdf = prawn::document.new(:page_size => 'legal', :page_layout => :landscape) pdf.table data,      :header => true,     :column_widths => widths,     :font_size => 7,     :row_colors => ["eeeeee", "ffffff"] 

i nomethoderror

undefined method `font_size=' #<prawn::table:0x6ce37ea4> 

when remove ":font_size => 7", renders undesirable font size.

i using prawn 0.12.0, ruby 1.9.3p194, , rails 3.1.9.

you have apply size property cell text directly. here how this:

pdf.table data,    :header => true,   :column_widths => widths,   :cell_style => { size: 7 },   :row_colors => ["eeeeee", "ffffff"] 

source: http://prawn.majesticseacreature.com/manual.pdf


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -