Guess i never committed my multi-line table lpdf fix. here it is.

This commit is contained in:
james 2007-05-09 17:18:01 +00:00
parent 878a29a9d1
commit 55fcc1cf06

View File

@ -557,18 +557,24 @@ class lpdf
{
$this->yloc-=$height['tabledata'];
$xpos=$xpos_of_table;
$extralinestomove=0;
for($c=0;$c<$table_cols;$c++)
{
$width=$table['widths'][$c];
$h=0;
for($h=1; $h<5;$h++) {
$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);
$textstr=$dataline[$c];
$h=1;
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($notfit == 0) {
break;
}
$this->yloc -= $height['tabledata'];
}
}while($notfit);
if($h-2>$extralinestomove) $extralinestomove=$h-2;
//put a little "..." at the end of the field
if($notfit)
@ -580,6 +586,8 @@ class lpdf
$xpos+=$width;
}
$this->yloc -= $height['tabledata']*$extralinestomove;
//draw the line below the table data)
pdf_moveto($this->pdf,$this->loc($xpos_of_table),$this->loc($this->yloc));