From 34a92a99a6956dcd97dfe417f68c436fceffc676 Mon Sep 17 00:00:00 2001 From: Carlos Goce Date: Fri, 23 Jan 2015 21:14:10 +0100 Subject: Improve simple pdf design --- lib/carlosgoce/layout/layouts.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/carlosgoce/layout/layouts.rb b/lib/carlosgoce/layout/layouts.rb index 946285d..e9c1ce8 100644 --- a/lib/carlosgoce/layout/layouts.rb +++ b/lib/carlosgoce/layout/layouts.rb @@ -6,14 +6,22 @@ module CarlosGoce module Layout class Simple def create (file, data, year) + tables = [] + Prawn::Document.generate(file) do data.each do |k, month| days = data[k][:days] - text data[k][:name] + # text data[k][:name] cells = (days).to_a.each_slice(7).to_a - table cells, :cell_style => {:align => :center} + + tables << make_table(cells, :cell_style => {:align => :center}) end + + table( + tables.each_slice(3).to_a, + :cell_style => {:align => :center, :padding => [5, 5, 5, 5]} + ) end end end -- cgit v1.2.3