I'm trying to write text to a pdf. But if the text is long enough it overflows from the page. Is there any way to write text into a text box.For fPdf there is a MultiCell() function. Is there any such function in Zend?
+1
A:
I ran into the same problem and had to write my own solution using php's wordwrap()
function. I took the output from that and then did a explode($output, "\n")
and looped over the resulting array to print each line with Zend_Pdf_Page::drawText()
Mark
2010-01-15 18:32:24
+1
A:
I wrote a text wrapper for zend's pdf and table generator as well. But there are other extensions in the ZF tracker as other people have proposals that are not excepted into the main ZF distro, meh politics in code really is a damper.
http://www.gorilla3d.com/v8/zend-pdf-text-wrapping-and-tables?article_group_id=5
$pdf = new Zend_Pdf();
$page = new Gorilla_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER);
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_COURIER);
//-- Header
$page->setFont($font, 24);
$page->drawMultilineText(array('Purchase Order'), 390, 48);
Gorilla3D
2010-01-17 05:42:07