如何将fpdf中的文本居中?

发布于 2024-10-10 17:07:59 字数 108 浏览 0 评论 0原文

如何让生成的文本显示在页面中央。

生成= $_POST 方法...所以我不知道输入中的文本有多长...所以我需要以某种方式有一个预先确定的中心参数...

有什么想法/吗?

How can I have this generated text appear centered in the page.

Generated = $_POST method ... so I dont know how long will the text in input be... so I need to have a pre-determined center parameter somehow...

any ideas/??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离不开的别离 2024-10-17 17:07:59

您希望文本水平居中还是垂直居中?

在第一种情况下,您可以创建一个单元格或多单元格(用于分割多行的文本(http://www.id.uzh.ch/cl/zinfo/fpdf/doc/cell.htm http://www.id.uzh.ch/cl/zinfo/fpdf/doc/multicell .htm ),没有边框/背景,宽度为零(以便它到达页面的右边距)并且居中对齐,

我不知道是否有更简单的方法来避免单元格。

Do you want text to be centered horizontally or vertically?

In the first case, you could create a Cell or MultiCell (for text that splits across many lines (http://www.id.uzh.ch/cl/zinfo/fpdf/doc/cell.htm http://www.id.uzh.ch/cl/zinfo/fpdf/doc/multicell.htm ) with no borders/background with zero width (so that it reaches the right margin of the page) and centre alignment.

I don't know if there is any easier way, avoiding the cells.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文