Class Mage_Sales_Model_Order_Pdf_Abstract

Description

Sales Order PDF abstract model

Located in /Sales/Model/Order/Pdf/Abstract.php (line 35)

Varien_Object
   |
   --Mage_Sales_Model_Order_Pdf_Abstract
Direct descendents
Class Description
Mage_Sales_Model_Order_Pdf_Creditmemo Sales Order Creditmemo PDF model
Mage_Sales_Model_Order_Pdf_Invoice Sales Order Invoice PDF model
Mage_Sales_Model_Order_Pdf_Shipment Sales Order Shipment PDF model
Class Constant Summary
XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id'
XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id'
XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id'
Variable Summary
mixed $y
Zend_Pdf $_pdf
array $_renderers
Method Summary
Zend_Pdf_Page drawLineBlocks ( $page,  $draw, [ $pageSettings = array()])
int getAlignCenter (string $string, int $x, int $columnWidth,  $font, int $fontSize)
int getAlignRight (string $string, int $x, int $columnWidth,  $font, int $fontSize, [int $padding = 5])
Zend_Pdf getPdf ()
void insertAddress ( &$page, [ $store = null])
void insertLogo ( &$page, [ $store = null])
void insertOrder ( &$page,  $obj, [ $putOrderId = true])
void insertTotals ( $page,  $source)
Zend_Pdf_Page newPage ([ $settings = array()])
float widthForStringUsingFontSize (string $string, Zend_Pdf_Resource_Font $font, float $fontSize)
void _afterGetPdf ()
void _beforeGetPdf ()
Zend_Pdf_Page _drawItem ( $item,  $page, Mage_Sales_Model_Order $order)
array _formatAddress (string $address)
void _formatOptionValue ( $value,  $order)
Zend_Pdf _getPdf ()
void _getTotalsList ( $source)
void _initRenderer ( $type)
void _parseItemDescription ( $item)
void _setFontBold ( $object, [ $size = 7])
void _setFontItalic ( $object, [ $size = 7])
void _setFontRegular ( $object, [ $size = 7])
void _sortTotalsList ( $a,  $b)
Variables
mixed $y (line 37)
  • access: public
mixed $_defaultTotalModel = 'sales/order_pdf_total_default' (line 59)
  • access: protected
Zend_Pdf $_pdf (line 57)

Zend PDF object

  • access: protected
array $_renderers = array() (line 46)

Item renderers with render type key

model => the model name renderer => the renderer model

  • access: protected
Methods
drawLineBlocks (line 663)

Draw lines

draw items array format: lines array;array of line blocks (required) shift int; full line height (optional) height int;line spacing (default 10)

line block has line columns array

column array format text string|array; draw text (required) feed int; x position (required) font string; font style, optional: bold, italic, regular font_file string; path to font file (optional for use your custom font) font_size int; font size (default 7) align string; text align (also see feed parametr), optional left, right height int;line spacing (default 10)

  • throws: Mage_Core_Exception
  • access: public
Zend_Pdf_Page drawLineBlocks ( $page,  $draw, [ $pageSettings = array()])
  • Zend_Pdf_Page $page
  • array $draw
  • array $pageSettings
getAlignCenter (line 124)

Calculate coordinates to draw something in a column aligned to the center

  • access: public
int getAlignCenter (string $string, int $x, int $columnWidth,  $font, int $fontSize)
  • string $string
  • int $x
  • int $columnWidth
  • Zend_Pdf_Resource_Font $font
  • int $fontSize
getAlignRight (line 108)

Calculate coordinates to draw something in a column aligned to the right

  • access: public
int getAlignRight (string $string, int $x, int $columnWidth,  $font, int $fontSize, [int $padding = 5])
  • string $string
  • int $x
  • int $columnWidth
  • Zend_Pdf_Resource_Font $font
  • int $fontSize
  • int $padding
getPdf (line 66)

Retrieve PDF

  • abstract:
  • access: public
Zend_Pdf getPdf ()

Redefined in descendants as:
getRenderer (line 546)

Public method of protected @see _getRenderer()

Retrieve renderer model

  • access: public
Mage_Sales_Model_Order_Pdf_Items_Abstract getRenderer (string $type)
  • string $type
insertAddress (line 143)
  • access: protected
void insertAddress ( &$page, [ $store = null])
  • &$page
  • $store
insertLogo (line 130)
  • access: protected
void insertLogo ( &$page, [ $store = null])
  • &$page
  • $store
insertOrder (line 183)
  • access: protected
void insertOrder ( &$page,  $obj, [ $putOrderId = true])
  • &$page
  • $obj
  • $putOrderId
insertTotals (line 417)
  • access: protected
void insertTotals ( $page,  $source)
  • $page
  • $source
newPage (line 628)

Create new page and assign to PDF object

  • access: public
Zend_Pdf_Page newPage ([ $settings = array()])
  • array $settings

Redefined in descendants as:
widthForStringUsingFontSize (line 82)

Returns the total width in points of the string using the specified font and size.

This is not the most efficient way to perform this calculation. I'm concentrating optimization efforts on the upcoming layout manager class. Similar calculations exist inside the layout manager class, but widths are generally calculated only after determining line fragments.

  • access: public
float widthForStringUsingFontSize (string $string, Zend_Pdf_Resource_Font $font, float $fontSize)
  • string $string
  • Zend_Pdf_Resource_Font $font
  • float $fontSize: Font size in points
_afterGetPdf (line 479)

After getPdf processing

  • access: protected
void _afterGetPdf ()
_beforeGetPdf (line 469)

Before getPdf processing

  • access: protected
void _beforeGetPdf ()
_drawItem (line 559)

Draw Item process

  • access: protected
Zend_Pdf_Page _drawItem ( $item,  $page, Mage_Sales_Model_Order $order)
_formatAddress (line 169)

Format address

  • access: protected
array _formatAddress (string $address)
  • string $address
_formatOptionValue (line 485)
  • access: protected
void _formatOptionValue ( $value,  $order)
  • $value
  • $order
_getPdf (line 613)

Retrieve PDF object

  • throws: Mage_Core_Exception
  • access: protected
Zend_Pdf _getPdf ()
_getRenderer (line 521)

Retrieve renderer model

  • throws: Mage_Core_Exception
  • access: protected
  • $type
_getTotalsList (line 392)
  • access: protected
void _getTotalsList ( $source)
  • $source
_initRenderer (line 504)
  • access: protected
void _initRenderer ( $type)
  • $type
_parseItemDescription (line 454)
  • access: protected
void _parseItemDescription ( $item)
  • $item
_setFontBold (line 581)
  • access: protected
void _setFontBold ( $object, [ $size = 7])
  • $object
  • $size
_setFontItalic (line 588)
  • access: protected
void _setFontItalic ( $object, [ $size = 7])
  • $object
  • $size
_setFontRegular (line 574)
  • access: protected
void _setFontRegular ( $object, [ $size = 7])
  • $object
  • $size
_setPdf (line 601)

Set PDF object

  • access: protected
  • Zend_Pdf $pdf
_sortTotalsList (line 380)
  • access: protected
void _sortTotalsList ( $a,  $b)
  • $a
  • $b
Class Constants
XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id' (line 50)
XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id' (line 48)
XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id' (line 49)

Documentation generated on Fri, 11 Feb 2011 16:54:50 +0200 by phpDocumentor 1.4.3