aboutsummaryrefslogtreecommitdiffstats
path: root/lib/carlosgoce/layout
diff options
context:
space:
mode:
authorCarlos Goce <carlosgoce@gmail.com>2015-01-23 21:14:10 +0100
committerCarlos Goce <carlosgoce@gmail.com>2015-01-23 21:14:10 +0100
commit34a92a99a6956dcd97dfe417f68c436fceffc676 (patch)
tree0103b2e7db84337c4171423c0e4c840676017426 /lib/carlosgoce/layout
parentf690f7da69f7dc9d19df0fdb378ca6a7f89d8a39 (diff)
downloadpdf-calendars-34a92a99a6956dcd97dfe417f68c436fceffc676.tar.gz
pdf-calendars-34a92a99a6956dcd97dfe417f68c436fceffc676.tar.bz2
pdf-calendars-34a92a99a6956dcd97dfe417f68c436fceffc676.zip
Improve simple pdf design
Diffstat (limited to 'lib/carlosgoce/layout')
-rw-r--r--lib/carlosgoce/layout/layouts.rb12
1 files changed, 10 insertions, 2 deletions
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