Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created September 13, 2008 18:20
Show Gist options
  • Select an option

  • Save practicingruby/10629 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/10629 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment