Dompdf text-align:justify在使用下标时失败

时间:2013-11-30 11:25:50

标签: dompdf

在我们的化学会议上,我们使用dompdf进行抽象提交:用户可以使用在线表单提交摘要,并可以预览pdf输出。

在用户使用下标的文本行中,文本对齐失败(右边框空间太大)存在一个特定问题:

<? require_once("dompdf/dompdf_config.inc.php");

$dompdf = new DOMPDF();

$html =
  '
  <html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
    </head>
  <body style="font-family: \'dejavu sans\'; line-height: 95%;">

  <div style="text-align: justify;font-size:9pt;">
    <p>To account for solvation effects and ligand substitution reactions, the polarizable continuum model (IEFPCM) option, explicit water molecules and sulphate ions, and different arrangement of ligands were employed, respectively. The D<sub>2</sub>O/H<sub>2</sub>O exchange influence on the simulated and experimentally observed Raman spectra was evaluated. The data of molecular modeling indicate the formation of octahedral iron(III) complex with thiocyanate and sulphate anions and (or) water molecules. </p>
    </div></body>

  </html>';

$dompdf->load_html($html);
$dompdf->set_paper('a5', 'portrait');
$dompdf->render();
$pdfoutput = $dompdf->output(); 
$filename = 'preview_subscript.pdf'; 
$fp = fopen('previews/'.$filename, "a"); 
fwrite($fp, $pdfoutput); 
fclose($fp); 
?>

PDF输出:http://www.chemcys.be/previews/preview_subscript.pdf

注意第四行的额外空白区域。

当我删除下标时,问题就消失了。 此外,当我使用Arial字体时问题消失了,但我们确实需要dejavu sans字体来支持unicode字符。

0 个答案:

没有答案