Exemplo n.º 1
0
 /**
  * Draw Sender Address
  *
  * @param SimpleXMLElement $addressLines
  * @param string $phoneNumber
  * @return float
  * @throws Zend_Pdf_Exception
  */
 protected function _drawSenderAddress(SimpleXMLElement $addressLines, $phoneNumber)
 {
     $lines = array();
     foreach ($addressLines as $line) {
         $lines[] = $line;
     }
     $pageY = 0;
     if (strlen($lines[0]) > 28) {
         $firstLine = array_shift($lines);
         $pageY = $this->_page->drawLines(array($firstLine), $this->_x(25), $this->_y(42), 28);
         $this->_page->drawText($phoneNumber, $this->_x(103), $this->_y(42));
     } else {
         $pageY = $this->_y(42);
         $lineLength = $this->_page->getTextWidth($lines[0] . ' ', $this->_page->getFont(), $this->_page->getFontSize());
         $this->_page->drawText($phoneNumber, $this->_x(25 + $lineLength), $this->_y(42));
     }
     return $this->_page->drawLines($lines, $this->_x(25), $pageY, 49);
 }