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