脚本宝典收集整理的这篇文章主要介绍了php – TCPDF:如何以正确的方式设置FONT SIZE,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$text1 = 'AAAg'; $text1_x = 5; $text1_y = 5; $text1_font_size = 5; $text2 = 'BBBg'; $text2_x = 10; $text2_y = 10; $text2_font_size = 10; $text3 = 'CCCg'; $text3_x = 15; $text3_y = 15; $text3_font_size = 15; // I tried $pdf->Cell and $pdf->Text... both are doing the same...
解决方案……
>使用’setPageUnIT’设置文档单元.
>如果我们有像素尺寸,我们必须将其转换为’pixelsToUnits’.
PHP – tcPDF示例:
$pdf->setPageUnit('pt'); $document_width = $pdf->pixelsToUnits('100'); $document_height = $pdf->pixelsToUnits('100'); $x = $pdf->pixelsToUnits('20'); $y = $pdf->pixelsToUnits('20'); $font_size = $pdf->pixelsToUnits('20'); $txt = 'AAAg'; $pdf->SetFont ('helvetica','',$font_size,'default',true ); $pdf->Text ( $x,$y,$txt,false,true,'T','M',false );
以上是脚本宝典为你收集整理的php – TCPDF:如何以正确的方式设置FONT SIZE全部内容,希望文章能够帮你解决php – TCPDF:如何以正确的方式设置FONT SIZE所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。