/** * Dessine l'entete du tableau avec la liste des produits * * @param unknown_type $page */ public function drawTableHeader(&$page) { //entetes de colonnes $this->y -= 15; $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 12); $page->drawText(mage::helper('purchase')->__('Qty'), 15, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Manufacturer'), 70, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Sku'), 180, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Product'), 310, $this->y, 'UTF-8'); //barre grise fin entete colonnes $this->y -= 8; $page->drawLine(10, $this->y, $this->_BLOC_ENTETE_LARGEUR, $this->y); $this->y -= 15; }
/** * Dessine du texte dans un bloc en permettant l'alignement horizontal * * @param unknown_type $page * @param unknown_type $text * @param unknown_type $x * @param unknown_type $y * @param unknown_type $width * @param unknown_type $height * @param unknown_type $alignment */ public function drawTextInBlock(&$page, $text, $x, $y, $width, $height, $alignment = 'c', $encoding = 'UTF-8') { //$page->drawRectangle($x, $y, $x + $width, $y + $height, Zend_Pdf_Page::LINE_DASHING_SOLID); //recupere la largeur du texte $text_width = $this->widthForStringUsingFontSize($text, $page->getFont(), $page->getFontSize()); switch ($alignment) { case 'c': //on centre le texte dans le bloc $x = $x + $width / 2 - $text_width / 2; break; case 'r': //on aligne à droite $x = $x + $width - $text_width; } $page->drawText(trim(strip_tags($text)), $x, $y, $encoding); }
/** * Dessine l'entete du tableau avec la liste des produits * * @param unknown_type $page */ public function drawTableHeader(&$page) { //entetes de colonnes $this->y -= 15; $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 10); $page->drawText(mage::helper('purchase')->__('SKU'), 15, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Model #'), 80, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Description'), 160, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('HTS code'), 300, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Unit Price'), 440, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Qty'), 390, $this->y, 'UTF-8'); //$page->drawText(mage::helper('purchase')->__('WEEE'), 365, $this->y, 'UTF-8'); //$page->drawText(mage::helper('purchase')->__('Tax'), 410, $this->y, 'UTF-8'); $page->drawText(mage::helper('purchase')->__('Total HT'), 510, $this->y, 'UTF-8'); //$page->drawText(mage::helper('purchase')->__('Total + Duty'), 530, $this->y, 'UTF-8'); //barre grise fin entete colonnes $this->y -= 8; $page->drawLine(10, $this->y, $this->_BLOC_ENTETE_LARGEUR, $this->y); $this->y -= 15; }