这是一个CSS类代码
.divLineHeight {
font-weight: 600;
line-height: 35px; !important;
}
我已将此 CSS 类添加到表 td 中。由于这是 MPDF,line-height CSS 属性不起作用。所以报告 PDF 视图中的措辞重叠。
<td class="border">
@if($documentSystemID == 11 || $documentSystemID == 8)
@if($act['action_area'])
<span class="fa-arrow-circle-right">></span>
<div class="divLineHeight" style="line-height: 2em !important;">{!! nl2br(strip_tags($act['action_area']['description'])) !!}</div>
@endif
@else
<span
class="fa-arrow-circle-right">></span>
<div class="divLineHeight" style="line-height: 2em !important;">{!! nl2br(strip_tags($act['actionTitle'])) !!}</div>
@endif
<br>
@if(isset($act['actionDescription']) && !empty($act['actionDescription']))
<span class="fa-arrow-circle-right">></span>
<div class="divLineHeight" style="line-height: 2em !important;">{!! nl2br(strip_tags($act['actionDescription'])) !!}</div>
@endif
</td>
这是打印时使用的代码
$html = view('print.report', $output);
$pathToFile = 'report' . $ID . '_' . time() . '.pdf';
$mpdf = new \Mpdf\Mpdf(['tempDir' => public_path('tmp')]);
$mpdf->AddPage('P', '', '', '', '', 0, 0, 0, 0, 0, 0);
$mpdf->showWatermarkText = false;
$mpdf->WriteHTML($html);
$mpdf->Output($pathToFile);
DeleteTemporaryFiles::dispatch($pathToFile)->delay(now()->addMinutes(2));
return $this->sendResponse(array('pdf_path' => $pathToFile), 'successfully created pdf');