This module provides tools to simplify some common drawing operations. It is included by default in the PDF formatter.
Alias for PDF::Writer#absolute_bottom_margin
# File lib/ruport/formatter/pdf.rb, line 347 def bottom_boundary pdf_writer.absolute_bottom_margin end
Alias for PDF::Writer#y
# File lib/ruport/formatter/pdf.rb, line 352 def cursor pdf_writer.y end
Draws text at an absolute location, defined by :y, :x1|:left, :x2|:right
All options to add_text are also supported.
# File lib/ruport/formatter/pdf.rb, line 360 def draw_text(text,text_opts) ypos = cursor move_cursor_to(text_opts[:y]) if text_opts[:y] add_text(text, text_opts.merge(:absolute_left => text_opts[:x1] || text_opts[:left], :absolute_right => text_opts[:x2] || text_opts[:right])) move_cursor_to(ypos) end
Draws text at an absolute location, defined by :y, :x1|:left
The x position defaults to the left margin and the y position defaults to the current cursor location.
Uses PDF::Writer#add_text, so it will ignore any options not supported by that method.
# File lib/ruport/formatter/pdf.rb, line 377 def draw_text!(text,text_opts) ypos = cursor pdf_writer.add_text(text_opts[:x1] || text_opts[:left] || left_boundary, text_opts[:y] || ypos, text, text_opts[:font_size], text_opts[:angle] || 0) move_cursor_to(ypos) end
# File lib/ruport/formatter/pdf.rb, line 387 def finalize render_pdf end
Draws a horizontal line from x1 to x2
# File lib/ruport/formatter/pdf.rb, line 313 def horizontal_line(x1,x2) pdf_writer.line(x1,cursor,x2,cursor) pdf_writer.stroke end
Draws a horizontal line from left_boundary to right_boundary
# File lib/ruport/formatter/pdf.rb, line 319 def horizontal_rule horizontal_line(left_boundary,right_boundary) end
Alias for PDF::Writer#absolute_left_margin
# File lib/ruport/formatter/pdf.rb, line 332 def left_boundary pdf_writer.absolute_left_margin end
Alias for PDF::Writer#absolute_right_margin
# File lib/ruport/formatter/pdf.rb, line 337 def right_boundary pdf_writer.absolute_right_margin end
Generated with the Darkfish Rdoc Generator 2.