douju7245 2014-05-23 09:30
浏览 999

mPDF:当表中的字符串太长时,文本变小

I am building a mPDF code with information fetched from the database.

When the user inserts too much text, when it's printed in the mPDF, the size of the text becomes realy small. I want the text to have the same size as the rest of the document in the PDF.

Here's my code:

$mpdf->AddPage();
$mpdf->WriteHTML("<h1>Habilitações Literárias</h1>");
$mpdf->WriteHTML("<br>");

$query2=mysql_query("SELECT * from hl where id_user='$idd'" );
$row2 = array();

while ($data2 = mysql_fetch_array($query2)) {
    $row2[] = $data2; 
}

foreach ($row2 as $x2) {
    $dataa2 = $x2[0];
    $instituicao = $x2[1];
    $descricao2 = $x2[2];
    $mpdf->WriteHTML("<table border='0' width='100%'>");
    $mpdf->WriteHTML("<tr><td><b>Instituição:</b> $instituicao</td> <td><b>Data:</b> $dataa2 </td></tr>   ");
    $mpdf->WriteHTML("<tr><td><b>Descrição:</b> $descricao2 </td></tr>");
    $mpdf->WriteHTML("</table>");
    $mpdf->WriteHTML("<hr>");
}

Here is a link of an image with the example: http://i.imgur.com/HNT0Rkg.png

As you can see, the text is really small on the last record, because the "Descricao" field is very large.

  • 写回答

2条回答 默认 最新

  • doutizong8099 2016-07-07 07:35
    关注

    I just fixed similar problem, with style="overflow:wrap" after reading the source code:

    elseif ($table['overflow']=='wrap')
    
    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题