gofpdf
gofpdf copied to clipboard
Dynamic Page Breaks
I have a requirement where it is necessary for blocks of text to not be broken in the middle ie. if a page break is necessary the block should start on a new page. Is this possible?
If the block of text uses only one font and attribute, the method SplitLines()
will let you know how much vertical space will be required to render it. You could use this along with GetY()
and SetAutoPageBreak(false, 0.0)
to force a page break if the remaining space on the current page is not sufficient.
It would be nice to implement a Mark()
method that would be followed by output methods and then either a Commit()
or Rollback()
. But that does not currently exist in gofdpf.