Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Zend PDF 来绘制文本,如下所示:
$page->drawText('Hinweis: ' . $note, $this->getAlignCenter('Hinweis: ' . $note, 66, 100, $font, $fontSize), $this->y, 'UTF-8');
根据多长时间$note,文本被放置在其他地方。我怎么能总是从左边框对齐完整的文本,比如 30px?
$note
getAlignCenter()计算文本需要居中对齐的位置。如果您只是想左对齐,请提供所需的x坐标而不是使用getAlignCenter().
getAlignCenter()
x