mPDF字体大小不适用于表格中的长文本 [英] mPDF font-size not working for long text in a table
问题描述
使用mPDF将html打印为pdf时,我在html中设置的字体大小在创建pdf时未正确设置. 在我的html中,我有
Using mPDF to print html to pdf the font-size I set in html is not properly set in creating the pdf. In my html I have
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-family:myriadpro, Verdana, sans-serif; color:#111111;">
<tr>
<td align="left" style="vertical-align:top; padding:5px; font-size: 12pt;">
etc.
但是,mPDF将PDF中的字体大小缩放为9pt.如果我使用24pt,它将缩放为18pt.我检查并尝试更改mPDF中的配置和显示首选项(NoPrintScaling),但是这些都不起作用.
However mPDF scales the font-size to 9pt in the PDF. If I use 24pt it scales to 18pt. I checked and tried to change the configs and displaypreferences (NoPrintScaling) in mPDF but none of this is working.
有人知道如何消除这种缩放吗?我不想设置较大的字体大小来补偿mPDF行为,因为这会破坏我的html视图.
Has anybody got a clue on how to get rid of this scaling? I don´t want to set the font-size bigger to compensate for mPDF behaviour because that will ruin my html view.
推荐答案
mPDF使用自动调整表格大小,除其他外,这也会影响字体大小.用mPDF输出表时,您需要进行以下设置:
mPDF uses autosizing tables and this influences, among other things, the font-size as well. When outputting tables with mPDF you need to set:
<table style="overflow: wrap">
在每张桌子上.请参阅 mPDF手册中的自动布局算法以供参考.
on every table. See Auto-layout algorithm in the mPDF manual for reference.
这篇关于mPDF字体大小不适用于表格中的长文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!