class Cucumber::Formatter::Pdf
def flush
if that too high for the space left on the age in the real document, we do a page break.
This method does a 'test' rendering on a blank page, to see the rendered height of the buffer
def flush @scrap.start_new_page oldy = @scrap.y render @scrap height = (oldy - @scrap.y) + 36 # whops magic number if ((@pdf.y - height) < @pdf.bounds.bottom) @pdf.start_new_page end render @pdf @pdf.move_down(20) @buffer = [] end