Fix things running over the bottom of the footer in PDF's

Also, if a heading is going to be the last thing on the page, move it to the top of the next page.
This commit is contained in:
james 2005-04-15 16:44:26 +00:00
parent 44f40885e5
commit 2f8921a7a0

View File

@ -178,6 +178,14 @@ class lpdf
function heading($text)
{
//if we are close to the bottom, lets just move the whole heading to the next page.
//no point putting the heading here then the new text on the next page.
//12/72 is height of the heading
//4/72 is the space under the heading
if($this->yloc< (1.1 + 12/72 + 4/72) )
$this->newPage();
pdf_setfont($this->pdf,$this->headerfont,12);
//move down the full line height
$this->yloc-=12/72;
@ -185,6 +193,7 @@ class lpdf
pdf_setfont($this->pdf,$this->normalfont,$this->currentFontSize);
//now leave some space under the heading (4 is 1/3 of 12, so 1/3 of the line height we leave)
$this->yloc-=4/72;
}
@ -250,7 +259,7 @@ class lpdf
pdf_lineto($this->pdf,$this->loc($xpos_of_table+$table_width),$this->loc($this->yloc));
pdf_stroke($this->pdf);
if($this->yloc<1)
if($this->yloc<1.1)
{
//now draw all the vertical lines
$xpos=$xpos_of_table;