forked from science-ation/science-ation
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:
parent
44f40885e5
commit
2f8921a7a0
11
lpdf.php
11
lpdf.php
@ -178,6 +178,14 @@ class lpdf
|
|||||||
|
|
||||||
function heading($text)
|
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);
|
pdf_setfont($this->pdf,$this->headerfont,12);
|
||||||
//move down the full line height
|
//move down the full line height
|
||||||
$this->yloc-=12/72;
|
$this->yloc-=12/72;
|
||||||
@ -185,6 +193,7 @@ class lpdf
|
|||||||
pdf_setfont($this->pdf,$this->normalfont,$this->currentFontSize);
|
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)
|
//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;
|
$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_lineto($this->pdf,$this->loc($xpos_of_table+$table_width),$this->loc($this->yloc));
|
||||||
pdf_stroke($this->pdf);
|
pdf_stroke($this->pdf);
|
||||||
|
|
||||||
if($this->yloc<1)
|
if($this->yloc<1.1)
|
||||||
{
|
{
|
||||||
//now draw all the vertical lines
|
//now draw all the vertical lines
|
||||||
$xpos=$xpos_of_table;
|
$xpos=$xpos_of_table;
|
||||||
|
Loading…
Reference in New Issue
Block a user