ZF-7145: Zend_Pdf_Page::drawText() with multi-line text

Issue Type: Improvement Created: 2009-06-27T16:49:48.000+0000 Last Updated: 2012-11-20T21:37:29.000+0000 Status: Open Fix version(s): Reporter: Remy Damour (remy215) Assignee: None Tags: - Zend_Pdf

Related issues: - ZF-1254




currently Zend_Pdf_Page::drawText() renders provided text within single line, whether provided text is multi-line or not. It would be great if it could handle multi-line text natively.

I quickly implemented it trhough by subclassing drawText() method with following code:

<pre class="highlight">
foreach (explode(PHP_EOL, $text) as $i => $line) {
    $page->drawText($line, $x, $y - $i * $page->getFontSize(), $encoding);

We could go further and increase flexibility by adding a line-height property on Zend_Pdf_Page and use this value as a line height to center text too.

Regards, Remy


Posted by Peter Moolenaar (petermoolenaar) on 2010-01-22T03:55:41.000+0000

I think multi-line issues are handled in another bug quite extensively

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.