I'm having issues with wordwrapping with Zend Framework2 PDF. I'm retrieving values from a database to write to a PDF template, but for simplicity's sake I just have a variable with a string:
$text = "ASDF ASDF ASDF ASDF ASDF ASDF ASDF";
$newtext = wordwrap($text, 20, "<br/>");
$page->drawText($newtext,50,50);
All this code is doing is inserting a
tag ever 20 characters:
ASDF ASDF ASDF ASDF<br/>ASDF ASDF ASDF
Any ideas, this can't be a limitation of ZF2 or ZendPDF can it?
Found some code that helped me solve it. Instead of trying to 1 drawText event to write a single string on multiple lines, you have to explode the string and loop through the array drawing each item on a line.