0

I'm using rospdf/php-pdf - the middle of the pdf is a table of variable length. I want to make sure there is enough space to print the final section on the page, if not I want to add a new page. I'd like to do something like this but $position has no value. How can I find out the current position?

$position = $pdf->ezSetDy;

if($position < 100){
    $pdf->ezNewPage();
}
Mike Volmar
  • 1,927
  • 1
  • 22
  • 31

1 Answers1

1

You can try the following:

$yPos = $pdf->y - $pdf->ez['bottomMargin'];
if ($yPos < 100) {
    $pdf->ezNewPage();
}
STE
  • 26
  • 1