function CheckPageBreak($h) { //If the height h would cause an overflow, add a new page immediately if ($this->GetY() + $h > $this->PageBreakTrigger) { $this->AddPage($this->CurOrientation); } }