Skip to content

Instantly share code, notes, and snippets.

@greg606
Created November 25, 2010 12:09
Show Gist options
  • Save greg606/715290 to your computer and use it in GitHub Desktop.
Save greg606/715290 to your computer and use it in GitHub Desktop.
Zend_Pdf text wrap
protected function wrapText($text)
{
$wrappedText = wordwrap($text, 110, "\n", false);
$token = strtok($wrappedText, "\n");
$this->_yPosition = $this->_pageHeight - 80;
while ($token !== false) {
$this->_page->drawText($token,
$this->_leftMargin,
$this->_yPosition);
$token = strtok("\n");
$this->_yPosition -= 15;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment