Php 多小区重叠

Php 多小区重叠,php,html,pdf,tcpdf,fpdf,Php,Html,Pdf,Tcpdf,Fpdf,我在PDF中有3个不同的表,它们是用TCPDF创建的,使用MultiCell来显示它们。它们是在彼此之上的,它们的名称是用writeHTML $html = '<html> <body> <p style="line-height: 10%"><h3>CarhireInfo</h3> </body> </html>'; $pdf->writeHTML($html, true, false, true, f

我在
PDF
中有
3个不同的表,它们是用
TCPDF
创建的,使用
MultiCell
来显示它们。它们是在彼此之上的,它们的
名称
是用
writeHTML

$html = '<html>
<body>
<p style="line-height: 10%"><h3>CarhireInfo</h3>
</body>
</html>';

$pdf->writeHTML($html, true, false, true, false, '');
$pdf->MultiCell($w=0, $h=0, $cars, $border=0, $align='L', $fill=false, $ln=0, $x='70', $y='74', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
$pdf->MultiCell($w=0, $h=0, $drivers, $border=0, $align='L', $fill=false, $ln=0, $x='125', $y='70', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
$pdf->Ln(20);

$html = '<html>
<body>
<p style="line-height: 0"><h3>Manager/-in</h3>
</body>
</html>';
$pdf->writeHTML($html, true, false, true, false, '');
$pdf->MultiCell($w=0, $h=0, $manager, $border=0, $align='L', $fill=false, $ln=0, $x='125', $y='90', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
$pdf->Ln(20);

$html = '<html>
<body>
<p style="line-height: 0"><h3>Descriptions</h3>
</body>
</html>';
$pdf->writeHTML($html, true, false, true, false, '');
$start_y = $pdf->GetY();
$start_page = $pdf->getPage();
$pdf->MultiCell($w=0, $h=0, $descriptions, $border=0, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);

$pdf->lastPage();
$pdf->Output('CarhireInfo.pdf', 'D');
$html='1!'
CarhireInfo
';
$pdf->writeHTML($html,true,false,true,false,”);
$pdf->MultiCell($w=0,$h=0,$cars,$border=0,$align=L',$fill=false,$ln=0,$x=70',$y=74',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0);
$pdf->MultiCell($w=0,$h=0,$drivers,$border=0,$align='L',$fill=false,$ln=0,$x='125',$y='70',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0);
$pdf->Ln(20);
$html='1
管理器/-in
';
$pdf->writeHTML($html,true,false,true,false,”);
$pdf->MultiCell($w=0,$h=0,$manager,$border=0,$align='L',$fill=false,$ln=0,$x='125',$y='90',$reseth=true,$stretch=0,$ishtml=false,$autoadding=true,$maxh=0);
$pdf->Ln(20);
$html='1
说明
';
$pdf->writeHTML($html,true,false,true,false,”);
$start_y=$pdf->GetY();
$start_page=$pdf->getPage();
$pdf->MultiCell($w=0,$h=0,$descriptions,$border=0,$align=L',$fill=false,$ln=1,$x='',$y='',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0);
$pdf->lastPage();
$pdf->Output('CarhireInfo.pdf','D');
我正在
定位
表格
,设置它们的
x
y
坐标
PDF
如下所示,如果我添加更多驱动程序,例如:

任何帮助都将不胜感激


你可以试试这样的东西

$html = '<html>
<body>
<p style="line-height: 10%"><h3>CarhireInfo</h3>
</body>
</html>';

$pdf->writeHTML($html, true, false, true, false, '');$startX1=$pdf->GetX();$startY1=$pdf->getY();
$pdf->MultiCell($w=0, $h=0, $cars, $border=0, $align='L', $fill=false, $ln=0, $x='70', $y='74', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);$startX2=$pdf->GetX();$startY2=$pdf->getY();
$pdf->MultiCell($w=0, $h=0, $drivers, $border=0, $align='L', $fill=false, $ln=0, $x='125', $y='70', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);$startX3=$pdf->GetX();$startY3=$pdf->getY();
//$pdf->Ln(20);

$html = '<html>
<body>
<p style="line-height: 0"><h3>Manager/-in</h3>
</body>
</html>';
if ($startY1>=$startY2 && $startY1>=$startY3){
  $pdf->setY($startY1);
}else if($startY2>=$startY3 && $startY2>=$startY1){
  $pdf->setY($startY2);
}else{
  $pdf->setY($startY3);
}
$pdf->writeHTML($html, true, false, true, false, '');$startX1=$pdf->GetX();$startY1=$pdf->getY();
$pdf->MultiCell($w=0, $h=0, $manager, $border=0, $align='L', $fill=false, $ln=0, $x='125', $y='90', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);$startX2=$pdf->GetX();$startY2=$pdf->getY();
//$pdf->Ln(20);

$html = '<html>
<body>
<p style="line-height: 0"><h3>Descriptions</h3>
</body>
</html>';
if ($startY1>=$startY2){
  $pdf->setY($startY1);
}else{
  $pdf->setY($startY2);
}
$pdf->writeHTML($html, true, false, true, false, '');
$start_y = $pdf->GetY();
$start_page = $pdf->getPage();
$pdf->MultiCell($w=0, $h=0, $descriptions, $border=0, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);

$pdf->lastPage();
$pdf->Output('CarhireInfo.pdf', 'D');
$html='1!'
CarhireInfo
';
$pdf->writeHTML($html,true,false,true,false,”)$startX1=$pdf->GetX()$startY1=$pdf->getY();
$pdf->MultiCell($w=0,$h=0,$cars,$border=0,$align=L',$fill=false,$ln=0,$x=70',$y=74',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0)$startX2=$pdf->GetX()$startY2=$pdf->getY();
$pdf->MultiCell($w=0,$h=0,$drivers,$border=0,$align='L',$fill=false,$ln=0,$x='125',$y='70',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0)$startX3=$pdf->GetX()$startY3=$pdf->getY();
//$pdf->Ln(20);
$html='1
管理器/-in
';
如果($startY1>=$startY2&&$startY1>=$startY3){
$pdf->setY($startY1);
}否则如果($startY2>=$startY3&&$startY2>=$startY1){
$pdf->setY($startY2);
}否则{
$pdf->setY($startY3);
}
$pdf->writeHTML($html,true,false,true,false,”)$startX1=$pdf->GetX()$startY1=$pdf->getY();
$pdf->MultiCell($w=0,$h=0,$manager,$border=0,$align='L',$fill=false,$ln=0,$x='125',$y='90',$reseth=true,$stretch=0,$ishtml=false,$autoadding=true,$maxh=0)$startX2=$pdf->GetX()$startY2=$pdf->getY();
//$pdf->Ln(20);
$html='1
说明
';
如果($startY1>=$startY2){
$pdf->setY($startY1);
}否则{
$pdf->setY($startY2);
}
$pdf->writeHTML($html,true,false,true,false,”);
$start_y=$pdf->GetY();
$start_page=$pdf->getPage();
$pdf->MultiCell($w=0,$h=0,$descriptions,$border=0,$align=L',$fill=false,$ln=1,$x='',$y='',$reseth=true,$stretch=0,$ishtml=false,$autopadding=true,$maxh=0);
$pdf->lastPage();
$pdf->Output('CarhireInfo.pdf','D');
希望能对你有所帮助