如何使用文本左下角的 XY 坐标在 TCPDF 中定位文本? [英] How do I position text in TCPDF using the XY coordinates of the bottom left of the text?

查看:32
本文介绍了如何使用文本左下角的 XY 坐标在 TCPDF 中定位文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想定位文本,以便在字体大小发生变化时,文本的基线保持不变.

I'd like to position text so that if the font size changes, the baseline of the text will stay the same.

当我使用

$pdf->SetXY($x,$y);
$pdf->Write(0, "Hello"......);

这将设置文本在其左上角的位置.

This sets the position of the text at its top left.

注意:我使用 write 来呈现文本.

Note: I am using write to render the text.

推荐答案

我使用了以下语法并且能够选择绝对位置来开始表格.

I used the following syntax and am able to chose the absolute position to start the table.

$pdf->SetFont('verdana', 'B', 18);
$pdf->SetXY(15, 20);

$output = <<<EOD
<table cellspacing="0" cellpadding="1" border="0">
.....
$pdf->writeHTML($output, true, false, false, false, '');

这篇关于如何使用文本左下角的 XY 坐标在 TCPDF 中定位文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆