# File lib/pdf/writer.rb, line 2097
2097:   def start_new_page(force = false)
2098:     page_required = true
2099: 
2100:     if @columns_on
2101:         # Check if this is just going to a new column. Increment the column
2102:         # number.
2103:       @columns[:current] += 1
2104: 
2105:       if @columns[:current] <= @columns[:size] and not force
2106:         page_required = false
2107:         @columns[:bot_y] = @y if @y < @columns[:bot_y]
2108:       else
2109:         @columns[:current] = 1
2110:         @top_margin = @columns[:top]
2111:         @columns[:bot_y] = absolute_top_margin
2112:       end
2113: 
2114:       w = @columns[:width]
2115:       g = @columns[:gutter]
2116:       n = @columns[:current] - 1
2117:       @left_margin = @columns[:left] + n * (g + w)
2118:       @right_margin = @page_width - (@left_margin + w)
2119:     end
2120: 
2121:     if page_required or force
2122:         # make a new page, setting the writing point back to the top.
2123:       @y = absolute_top_margin
2124:         # make the new page with a call to the basic class
2125:       if @insert_mode
2126:         id = new_page(true, @insert_page, @insert_position)
2127:         @pageset << id
2128:           # Manipulate the insert options so that inserted pages follow each
2129:           # other
2130:         @insert_page = id
2131:         @insert_position = :after
2132:       else
2133:         @pageset << new_page
2134:       end
2135: 
2136:     else
2137:       @y = absolute_top_margin
2138:     end
2139:     @pageset
2140:   end