如何解决<b> 标签的 TCPDF 对齐问题
我们面临一个奇怪的问题,即 TCPDF 无法正确打印 <b>
标签内的内容。它变得错位了。
代码如下:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION,PDF_UNIT,PDF_PAGE_FORMAT,true,'UTF-8',false);
$pdf->SetAutoPageBreak(TRUE,PDF_MARGIN_BOTTOM);
$pdf->AddPage();
$html = <<<EOF
<html dir="ltr" lang="en-gb">
<head>
<title data-cke-title="Rich Text Editor,idServiceTemplate">Rich Text Editor,idServiceTemplate</title>
</head>
<body contenteditable="true" class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" spellcheck="true">
<p align="left" style="text-align: left;">
<span style="font-size: 10.5pt;">
<span style="background: #ffffff;">
<span>
<b><span style="font-size: 9pt;"><span><span style="color: #000000;">GALL</span></span></span></b>
<b>
<span style="font-size: 9pt;">
<span><span style="color: #000000;">BLADDER</span></span>
</span>
</b>
<span style="font-size: 9pt;">
<span><span style="color: #000000;">: The gall bladder is distended and appears extra hepatic in location. No calculus is seen within it. </span></span>
</span>
</span>
</span>
</span>
</p>
</body>
</html>
EOF;
// output the HTML content
$pdf->writeHTML($html,false,'');
//Close and output PDF document
$pdf->Output('example_006.pdf','I');
假设如果我在之前添加一个空格,它就会被正确打印。例如:
问题:<b><span style="font-size: 9pt;"><span><span style="color: #000000;">GALL</span></span></span></b>
。 Check print here。
但以下工作正常
<b><span style="font-size: 9pt;"><span><span style="color: #000000;">GALL</span></span></span> </b>
Check print here.
有人知道这里有什么问题吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。