Zend Framework

Zend_Pdf_Page::drawText() with multi-line text

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.8.4
  • Fix Version/s: None
  • Component/s: Zend_Pdf
  • Labels:
    None

Description

Hi,

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:

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

Issue Links

Activity

Hide
Peter Moolenaar added a comment -

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

Show
Peter Moolenaar added a comment - I think multi-line issues are handled in another bug quite extensively

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: