合理对齐的 TCPDF 缩进问题

TCPDF Indent issue with justified align

一位开发人员为我创建了一个 TCPDF 表单,因为我有太多其他项目要处理并且没有使用 TCPDF 的经验。我有一个小问题,需要一些帮助才能解决。每个段落的第一行需要缩进半英寸,但段落需要对齐对齐。由于对齐对齐,缩进被丢弃并且段落不匹配。有办法解决这个问题吗?

$pdf = new MyPDF();
$intergine = 10;
$indent = str_repeat(" ", 10);
$indent_html = str_repeat(" ", 10);
$pdf->AddPage("P", array(215.9, 279.4));
$pdf->SetFont('helvetica', 'BU', 14);
$pdf->Cell(0, 6, "TEST CONTRACT", 0, 1, "C");

$pdf->Ln(5);
$pdf->setCellHeightRatio(2.4);
$pdf->SetFont('helvetica', 'B', 12);
//$pdf->MultiCell(0, $intergine, $indent . "Client(s): [contracts.clientName]\n", 0, 'J', 0, 12);

$clientname = "Client(s): <u>". $row['clientName']."</u>";
$pdf->MultiCell(0, $intergine, $indent . $clientname . "\n", 0, 'J', 0, 12, '45', '', true, 0, true);


$paragraph = "I hereby retain and employ the Law Office of John Smith, Attorney ";
$paragraph .= "at Law, 123 Main St, Tallahassee, FL 33333 ";
$paragraph .= "as my attorney to represent me in a cause of action against ";
$paragraph .= $row['insuranceCo'] . " or any other entity based on my flood claim, including any ";
$paragraph .= "and all building, contents and ICC claims, which occurred on or about ";
$paragraph .= $row['lossDate'] . " at or near " .  $row['lossLocation'] . ".";
$pdf->MultiCell(0, $intergine, $indent_html . $paragraph . "\n", 0, 'J', 0, 1, '', '', true, 0, true);

$paragraph = "As compensation for their services, I agree that my attorneys may pay ";
$paragraph .= "themselves from the gross amount of the recovery, before any sums whatsoever ";
$paragraph .= "are deducted from said gross amount of recovery for costs or other items, a ";
$paragraph .= "contingent fee based upon the following percentages of the gross amount of such recovery:";
$pdf->MultiCell(0, $intergine, $indent . $paragraph . "\n", 0, 'J', 0);

经过一些研究结合反复试验,我学会了使用 $writeHTMLCell 和完美工作的缩进样式。