lib/prawn/document.rb
# Executes a block and then restores the original y position. If new pages
# were created during this block, it will teleport back to the original
# page when done.
#
#   pdf.text "A"
#
#   pdf.float do
#     pdf.move_down 100
#     pdf.text "C"
#   end
#
#   pdf.text "B"
#
Executes a block and then restores the original y position. If new pages
were created during this block, it will teleport back to the original
page when done.






Executes a block and then restores the original y position . If new pages were created during this block it will teleport back to the original page when done .
def float
      original_page = page_number
      original_y = y
      original_bb = @bounding_box
      yield
      unless page_number == original_page
        go_to_page(original_page)
        self.bounds = original_bb if original_bb
      end
      self.y = original_y
    end
def float original_page = page_number original_y = y original_bb = @bounding_box yield unless page_number == original_page go_to_page ( original_page ) self . bounds = original_bb if original_bb end self . y = original_y end
Executes a block and then restores the original y position.
Executes a block and then restores the original y position .