SHARE
TWEET

Untitled

a guest Jan 12th, 2017 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  2.     <preference for="MagentoSalesModelOrderPdfItemsInvoiceDefaultInvoice" type="MycompanyTaxModelOrderPdfItemsInvoiceDefaultInvoice" />
  3.     <preference for="MagentoSalesModelOrderPdfInvoice" type="MycompanyTaxModelOrderPdfInvoice" />
  4.    
  5. /**
  6.      * Set font as regular
  7.      *
  8.      * @param  Zend_Pdf_Page $object
  9.      * @param  int $size
  10.      * @return Zend_Pdf_Resource_Font
  11.      */
  12.     protected function _setFontRegular($object, $size = 7)
  13.     {
  14.         $font = Zend_Pdf_Font::fontWithPath(
  15.             $this->getFontsDir() . ('dejavu-sans/DejaVuSansCondensed.ttf')
  16.         );
  17.         $object->setFont($font, $size);
  18.         return $font;
  19.     }
  20.     /**
  21.      * Set font as bold
  22.      *
  23.      * @param  Zend_Pdf_Page $object
  24.      * @param  int $size
  25.      * @return Zend_Pdf_Resource_Font
  26.      */
  27.     protected function _setFontBold($object, $size = 6)
  28.     {
  29.         $font = Zend_Pdf_Font::fontWithPath(
  30.             $this->getFontsDir() . ('dejavu-sans/DejaVuSansCondensed-Bold.ttf')
  31.         );
  32.         $object->setFont($font, $size);
  33.         return $font;
  34.     }
  35.  
  36.     /**
  37.      * Set font as italic
  38.      *
  39.      * @param  Zend_Pdf_Page $object
  40.      * @param  int $size
  41.      * @return Zend_Pdf_Resource_Font
  42.      */
  43.     protected function _setFontItalic($object, $size = 7)
  44.     {
  45.         $font = Zend_Pdf_Font::fontWithPath(
  46.             $this->getFontsDir() . ('dejavu-sans/DejaVuSans-Oblique.ttf')
  47.         );
  48.         $object->setFont($font, $size);
  49.         return $font;
  50.     }
RAW Paste Data
Top