bigpotato
bigpotato

Reputation: 27517

Ruby + Prawn: How do I make text stick to bottom of page?

I have footer text that needs to stay at the bottom of the page: "If you have any questions regarding your order, you may contact us". How would I position it absolutely?

Upvotes: 1

Views: 884

Answers (1)

Chris Cashwell
Chris Cashwell

Reputation: 22859

Here's one way from the docs:

file = "lazy_bounding_boxes.pdf"
Prawn::Document.generate(file, :skip_page_creation => true) do                    
  point = [bounds.right-50, bounds.bottom + 25]
  page_counter = lazy_bounding_box(point, :width => 50) do   
    text "Page: #{page_count}"
  end 

  10.times do         
   start_new_page
    text "Some text"  
    page_counter.draw
  end
end

Upvotes: 1

Related Questions