forked from science-ation/science-ation
Guess i never committed my multi-line table lpdf fix. here it is.
This commit is contained in:
parent
878a29a9d1
commit
55fcc1cf06
24
lpdf.php
24
lpdf.php
@ -557,18 +557,24 @@ class lpdf
|
|||||||
{
|
{
|
||||||
$this->yloc-=$height['tabledata'];
|
$this->yloc-=$height['tabledata'];
|
||||||
$xpos=$xpos_of_table;
|
$xpos=$xpos_of_table;
|
||||||
|
$extralinestomove=0;
|
||||||
for($c=0;$c<$table_cols;$c++)
|
for($c=0;$c<$table_cols;$c++)
|
||||||
{
|
{
|
||||||
$width=$table['widths'][$c];
|
$width=$table['widths'][$c];
|
||||||
$h=0;
|
$textstr=$dataline[$c];
|
||||||
for($h=1; $h<5;$h++) {
|
$h=1;
|
||||||
$notfit=pdf_show_boxed($this->pdf,$dataline[$c],$this->loc($xpos+$table_padding),$this->loc($this->yloc),$this->loc($width-2*$table_padding),$this->loc($height['tabledata'])*$h, $table['dataalign'][$c],null);
|
do
|
||||||
|
{
|
||||||
|
//get rid of any leading \n's they cause havok
|
||||||
|
if($textstr[0]=="\n") $textstr=substr($textstr,1);
|
||||||
|
$notfit=pdf_show_boxed($this->pdf,$textstr,$this->loc($xpos+$table_padding),$this->loc($this->yloc-($h-1)*$height['tabledata']),$this->loc($width-2*$table_padding),$this->loc($height['tabledata']),$table['dataalign'][$c],null);
|
||||||
|
$h++;
|
||||||
|
$textstr=substr($textstr,-$notfit);
|
||||||
|
|
||||||
if($allow_multiline == false) break; // default behaviour, don't try multi lines
|
if($allow_multiline == false) break; // default behaviour, don't try multi lines
|
||||||
if($notfit == 0) {
|
}while($notfit);
|
||||||
break;
|
|
||||||
}
|
if($h-2>$extralinestomove) $extralinestomove=$h-2;
|
||||||
$this->yloc -= $height['tabledata'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//put a little "..." at the end of the field
|
//put a little "..." at the end of the field
|
||||||
if($notfit)
|
if($notfit)
|
||||||
@ -580,6 +586,8 @@ class lpdf
|
|||||||
|
|
||||||
$xpos+=$width;
|
$xpos+=$width;
|
||||||
}
|
}
|
||||||
|
$this->yloc -= $height['tabledata']*$extralinestomove;
|
||||||
|
|
||||||
|
|
||||||
//draw the line below the table data)
|
//draw the line below the table data)
|
||||||
pdf_moveto($this->pdf,$this->loc($xpos_of_table),$this->loc($this->yloc));
|
pdf_moveto($this->pdf,$this->loc($xpos_of_table),$this->loc($this->yloc));
|
||||||
|
Loading…
Reference in New Issue
Block a user