Exemplo n.º 1
0
 /**
  * Add Receive Info
  *
  * @param SimpleXMLElement $consignee
  * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder
  * @throws Zend_Pdf_Exception
  */
 public function addReceiveInfo(SimpleXMLElement $consignee)
 {
     $this->_page->saveGS();
     $this->_page->setFont($this->_fontNormal, 9);
     $this->_page->drawText("To:", $this->_x(5), $this->_y(92));
     $this->_page->drawText($consignee->CompanyName, $this->_x(20), $this->_y(90));
     $y = $this->_page->drawLines($consignee->AddressLine, $this->_x(19), $this->_y(100), 50);
     $this->_page->setFont($this->_fontBold, 11);
     $cityInfo = implode(' ', array_filter(array($consignee->PostalCode, $consignee->City, $consignee->DivisionCode)));
     $y = min($y - 3, 460);
     $this->_page->drawLines(array($cityInfo, $consignee->CountryName), $this->_x(20), $y, 44);
     $this->_page->setFont($this->_fontNormal, 6);
     $this->_page->drawText('Contact:', $this->_x(260), $this->_y(90));
     $y = $this->_page->drawLines(array($consignee->Contact->PersonName), $this->_x(283), $this->_y(98), 25, Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT);
     $phoneNumber = implode(' ', array_filter(array($consignee->Contact->PhoneNumber, $consignee->Contact->PhoneExtension)));
     $this->_page->drawText($phoneNumber, $this->_x(283), $y, null, Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT);
     $this->_page->restoreGS();
     return $this;
 }