Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Playing with the prawn output a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Dec 14, 2009
1 parent bad725a commit c5d6ec4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/views/printable_directories/show.pdf.prawn
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ pdf.text "Created especially for #{@logged_in.name} on #{Date.today.strftime '%B
# directory pages
pdf.start_new_page

pdf.header([pdf.bounds.left, pdf.bounds.top], :height => 200) do
pdf.text "#{Setting.get(:name, :community)} Directory\n", :size => 24
pdf.move_down 5
pdf.horizontal_rule
pdf.stroke_line(0, 0, 0, 0) # FIXME: this is needed in order for horizontal_rule to work -- don't know why
end
# pdf.header(pdf.bounds.top_left, :height => 200) do
# pdf.text "#{Setting.get(:name, :community)} Directory\n", :size => 24
# pdf.move_down 5
# pdf.horizontal_rule
# pdf.stroke_line(0, 0, 0, 0) # FIXME: this is needed in order for horizontal_rule to work -- don't know why
# end

alpha = nil

Expand All @@ -28,10 +28,12 @@ pdf.column_box [pdf.bounds.left, 670], :width => pdf.bounds.width, :columns => 2
next unless family.mapable? or family.home_phone.to_i > 0
pdf.bounds.move_past_bottom if pdf.y < 130
if family.last_name[0..0] != alpha
pdf.move_down 150 if pdf.y < 150
pdf.move_down 150 if pdf.y < 150
alpha = family.last_name[0..0]
pdf.text alpha + "\n", :size => 25
pdf.horizontal_line pdf.bounds.left, pdf.bounds.left+pdf.bounds.width
pdf.stroke do
pdf.horizontal_line pdf.left_side, pdf.bounds.left_side+pdf.bounds.width
end
pdf.move_down 20
end
if family.has_photo?
Expand Down

0 comments on commit c5d6ec4

Please sign in to comment.