Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP FPDF多小区高度调整_Php_Fpdf - Fatal编程技术网

PHP FPDF多小区高度调整

PHP FPDF多小区高度调整,php,fpdf,Php,Fpdf,我试图使我的多小区和其他小区的高度调整到多小区的最高高度 使用下面的代码,这就是我的pdf看起来的样子。唯一的问题是我无法调整description列以与最高的MULTICELL(子代码)对齐。子代码和描述都是多小区的,其余的都是普通小区 $h1 = $pdf->GetMultiCellHeight(85, 5, $r->subdesc, $border=null, $align='J'); $h2 = $pdf->GetMultiCellHeight(35, 5, $r-&g

我试图使我的多小区和其他小区的高度调整到多小区的最高高度

使用下面的代码,这就是我的pdf看起来的样子。唯一的问题是我无法调整description列以与最高的MULTICELL(子代码)对齐。子代码和描述都是多小区的,其余的都是普通小区

$h1 = $pdf->GetMultiCellHeight(85, 5, $r->subdesc, $border=null, $align='J');
$h2 = $pdf->GetMultiCellHeight(35, 5, $r->subcode, $border=null, $align='J');
$height = ($h1 > $h2) ? $h1 : $h2;

                $pdf->Cell(20,$height,$r->section,1,0,'L');
                $pdf->Cell(15,$height,$r->code,1,0,'L');
                $subcode = ($r->wga == 1) ? '*'.$r->subcode : $r->subcode;

                $x = $pdf->GetX();
                $y = $pdf->GetY();
                $pdf->MultiCell(35, 5, iconv("UTF-8", "ISO-8859-1", $r->subcode), 1);
                $pdf->SetXY($x + 35, $y);

                $x = $pdf->GetX();
                $y = $pdf->GetY();
                $pdf->MultiCell(85, 5, iconv("UTF-8", "ISO-8859-1", $r->subdesc), 1,'L', false);
                $pdf->SetXY($x + 85, $y);

                $pdf->Cell(10,$height,$r->units,1,0,'C');
                $pdf->Cell(10,$height,$r->grade,1,0,'C');
                $pdf->Cell(20,$height,$r->remark,1,0,'C');
                $pdf->Ln();
两种方法: 1.绘制具有底部边框(具有正确高度)的空单元格和不具有底部边框的多单元格

$x = $pdf->GetX();
$y = $pdf->GetY();              
$pdf->Cell(195, $height, "", 1, 0, 'B');
$pdf->SetXY($x, $y);
$pdf->Cell(20,$height,$section,1,0,'L');
$pdf->Cell(15,$height,$code,1,0,'L');
$subcode = ($wga == 1) ? '*'.$subcode : $subcode;
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->MultiCell(35, 5, iconv("UTF-8", "ISO-8859-1", $subcode), 'L,T,R');
二,。即使是多小区线路:

$height = ($h1 > $h2) ? $h1 : $h2;
$subcode = ($wga == 1) ? '*'.$subcode : $subcode; //have to be done here
if($h1<$height){
  for($i=$h1; $i<=$height; $i++)
  $subdesc .= "\n";
}elseif($h2<$height){
  for($i=$h2; $i<=$height; $i++)
  $subcode .= "\n";
}
$height=($h1>$h2)$h1:$h2;
$subcode=($wga==1)?“*”$子代码:$子代码//必须在这里完成
如果($h1)