# File lib/pdf/writer.rb, line 584
584:   def margins_pt(top, left = top, bottom = top, right = left)
585:       # Set the margins to new values
586:     @top_margin    = top
587:     @bottom_margin = bottom
588:     @left_margin   = left
589:     @right_margin  = right
590:       # Check to see if this means that the current writing position is
591:       # outside the writable area
592:     if @y > (@page_height - top)
593:         # Move y down
594:       @y = @page_height - top
595:     end
596: 
597:     start_new_page if @y < bottom # Make a new page
598:   end