Method: PDF::Writer#move_pointer
- Defined in:
- lib/pdf/writer.rb
#move_pointer(dy, make_space = false) ⇒ Object
Used to change the vertical position of the writing point. The pointer is moved down the page by dy (that is, #y is reduced by dy), so if the pointer is to be moved up, a negative number must be used. Moving up the page will not move to the previous page because of limitations in the way that PDF::Writer works. The writing point will be limited to the top margin position.
If make_space is true and a new page is forced, then the pointer will be moved down on the new page. This will allow space to be reserved for graphics.
550 551 552 553 554 555 556 557 558 |
# File 'lib/pdf/writer.rb', line 550 def move_pointer(dy, make_space = false) @y -= dy if @y < @bottom_margin start_new_page @y -= dy if make_space elsif @y > absolute_top_margin @y = absolute_top_margin end end |