Guest User

Untitled

a guest
May 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def to_pdf
  2. d = Document.new :margin_top => 5, :margin_bottom => 2
  3. d.before_page_create do
  4. image "public/reports/papeltimbrado.eps"
  5. text_in :text => "Pg %current_page% de %count_pages%", :x => 18, :y => 27, :with => :normal
  6. end
  7.  
  8. 200.times do |n|
  9. d.show_next_row "Value #{n}"
  10. end
  11.  
  12. #d.define_variable(:count_pages, 34)
  13.  
  14. d.render :pdf, :filename => "public/test.pdf"
  15. end
Add Comment
Please, Sign In to add comment