Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
getPdf () | |
__construct (\Magento\Payment\Helper\Data $paymentData, \Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Filesystem $filesystem, Config $pdfConfig, \Magento\Sales\Model\Order\Pdf\Total\Factory $pdfTotalFactory, \Magento\Sales\Model\Order\Pdf\ItemsFactory $pdfItemsFactory, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, \Magento\Sales\Model\Order\Address\Renderer $addressRenderer, array $data=[]) | |
widthForStringUsingFontSize ($string, $font, $fontSize) | |
getAlignRight ($string, $x, $columnWidth, \Zend_Pdf_Resource_Font $font, $fontSize, $padding=5) | |
getAlignCenter ($string, $x, $columnWidth, \Zend_Pdf_Resource_Font $font, $fontSize) | |
insertDocumentNumber (\Zend_Pdf_Page $page, $text) | |
getRenderer ($type) | |
newPage (array $settings=[]) | |
drawLineBlocks (\Zend_Pdf_Page $page, array $draw, array $pageSettings=[]) | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
Data Fields | |
$y | |
const | XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id' |
const | XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id' |
const | XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id' |
Protected Member Functions | |
insertLogo (&$page, $store=null) | |
insertAddress (&$page, $store=null) | |
_formatAddress ($address) | |
_calcAddressHeight ($address) | |
insertOrder (&$page, $obj, $putOrderId=true) | |
_sortTotalsList ($a, $b) | |
_getTotalsList () | |
insertTotals ($page, $source) | |
_parseItemDescription ($item) | |
_beforeGetPdf () | |
_afterGetPdf () | |
_formatOptionValue ($value, $order) | |
_initRenderer ($type) | |
_getRenderer ($type) | |
_drawItem (\Magento\Framework\DataObject $item, \Zend_Pdf_Page $page, \Magento\Sales\Model\Order $order) | |
_setFontRegular ($object, $size=7) | |
_setFontBold ($object, $size=7) | |
_setFontItalic ($object, $size=7) | |
_setPdf (\Zend_Pdf $pdf) | |
_getPdf () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_renderers = [] | |
$_pdf | |
$_paymentData | |
$string | |
$_localeDate | |
$_scopeConfig | |
$_mediaDirectory | |
$_rootDirectory | |
$_pdfConfig | |
$_pdfTotalFactory | |
$_pdfItemsFactory | |
$inlineTranslation | |
$addressRenderer | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Sales Order PDF abstract model
@api @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 19 of file AbstractPdf.php.
__construct | ( | \Magento\Payment\Helper\Data | $paymentData, |
\Magento\Framework\Stdlib\StringUtils | $string, | ||
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, | ||
\Magento\Framework\Filesystem | $filesystem, | ||
Config | $pdfConfig, | ||
\Magento\Sales\Model\Order\Pdf\Total\Factory | $pdfTotalFactory, | ||
\Magento\Sales\Model\Order\Pdf\ItemsFactory | $pdfItemsFactory, | ||
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate, | ||
\Magento\Framework\Translate\Inline\StateInterface | $inlineTranslation, | ||
\Magento\Sales\Model\Order\Address\Renderer | $addressRenderer, | ||
array | $data = [] |
||
) |
\Magento\Payment\Helper\Data | $paymentData | |
\Magento\Framework\Stdlib\StringUtils | $string | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Framework\Filesystem | $filesystem | |
Config | $pdfConfig | |
Total\Factory | $pdfTotalFactory | |
ItemsFactory | $pdfItemsFactory | |
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate | |
\Magento\Framework\Translate\Inline\StateInterface | $inlineTranslation | |
\Magento\Sales\Model\Order\Address\Renderer | $addressRenderer | |
array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 133 of file AbstractPdf.php.
|
protected |
|
protected |
|
protected |
Calculate address height
array | $address |
Definition at line 350 of file AbstractPdf.php.
|
protected |
Draw Item process
\Magento\Framework\DataObject | $item | |
\Zend_Pdf_Page | $page | |
\Magento\Sales\Model\Order | $order |
Definition at line 836 of file AbstractPdf.php.
|
protected |
Format address
string | $address |
Definition at line 329 of file AbstractPdf.php.
|
protected |
Format option value process
array | string | $value | |
\Magento\Sales\Model\Order | $order |
Definition at line 758 of file AbstractPdf.php.
|
protected |
Retrieve PDF object
Definition at line 920 of file AbstractPdf.php.
|
protected |
Retrieve renderer model
string | $type |
Definition at line 798 of file AbstractPdf.php.
|
protected |
Return total list
Definition at line 656 of file AbstractPdf.php.
|
protected |
Initialize renderer process
string | $type |
Definition at line 783 of file AbstractPdf.php.
|
protected |
Parse item description
\Magento\Framework\DataObject | $item |
Definition at line 720 of file AbstractPdf.php.
|
protected |
Set font as bold
\Zend_Pdf_Page | $object | |
int | $size |
Definition at line 877 of file AbstractPdf.php.
|
protected |
Set font as italic
\Zend_Pdf_Page | $object | |
int | $size |
Definition at line 893 of file AbstractPdf.php.
|
protected |
Set font as regular
\Zend_Pdf_Page | $object | |
int | $size |
Definition at line 861 of file AbstractPdf.php.
|
protected |
Set PDF object
\Zend_Pdf |
Definition at line 908 of file AbstractPdf.php.
|
protected |
Sort totals list
array | $a | |
array | $b |
Definition at line 638 of file AbstractPdf.php.
drawLineBlocks | ( | \Zend_Pdf_Page | $page, |
array | $draw, | ||
array | $pageSettings = [] |
||
) |
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 parameter), optional left, right height int;line spacing (default 10)
\Zend_Pdf_Page | $page | |
array | $draw | |
array | $pageSettings |
Definition at line 973 of file AbstractPdf.php.
getAlignCenter | ( | $string, | |
$x, | |||
$columnWidth, | |||
\Zend_Pdf_Resource_Font | $font, | ||
$fontSize | |||
) |
Calculate coordinates to draw something in a column aligned to the center
string | $string | |
int | $x | |
int | $columnWidth | |
\Zend_Pdf_Resource_Font | $font | |
int | $fontSize |
Definition at line 223 of file AbstractPdf.php.
getAlignRight | ( | $string, | |
$x, | |||
$columnWidth, | |||
\Zend_Pdf_Resource_Font | $font, | ||
$fontSize, | |||
$padding = 5 |
|||
) |
Calculate coordinates to draw something in a column aligned to the right
string | $string | |
int | $x | |
int | $columnWidth | |
\Zend_Pdf_Resource_Font | $font | |
int | $fontSize | |
int | $padding |
Definition at line 207 of file AbstractPdf.php.
|
abstract |
Retrieve PDF
getRenderer | ( | $type | ) |
Public method of protected
Retrieve renderer model
string | $type |
Definition at line 823 of file AbstractPdf.php.
|
protected |
Insert address to pdf page
\Zend_Pdf_Page | &$page | |
null | $store |
Definition at line 291 of file AbstractPdf.php.
insertDocumentNumber | ( | \Zend_Pdf_Page | $page, |
$text | |||
) |
Insert title and number for concrete document type
\Zend_Pdf_Page | $page | |
string | $text |
Definition at line 623 of file AbstractPdf.php.
|
protected |
Insert logo to pdf page
\Zend_Pdf_Page | &$page | |
null | $store |
Definition at line 237 of file AbstractPdf.php.
|
protected |
Insert order to pdf page
\Zend_Pdf_Page | &$page | |
\Magento\Sales\Model\Order | $obj | |
bool | $putOrderId |
Definition at line 378 of file AbstractPdf.php.
|
protected |
Insert totals to pdf page
\Zend_Pdf_Page | $page | |
\Magento\Sales\Model\AbstractModel | $source |
Definition at line 678 of file AbstractPdf.php.
newPage | ( | array | $settings = [] | ) |
Create new page and assign to PDF object
array | $settings |
Definition at line 935 of file AbstractPdf.php.
widthForStringUsingFontSize | ( | $string, | |
$font, | |||
$fontSize | |||
) |
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.
string | $string | |
\Zend_Pdf_Resource_Font | $font | |
float | $fontSize | Font size in points |
Definition at line 174 of file AbstractPdf.php.
|
protected |
Definition at line 75 of file AbstractPdf.php.
|
protected |
Definition at line 87 of file AbstractPdf.php.
|
protected |
Definition at line 65 of file AbstractPdf.php.
|
protected |
Definition at line 51 of file AbstractPdf.php.
|
protected |
Definition at line 97 of file AbstractPdf.php.
|
protected |
Definition at line 107 of file AbstractPdf.php.
|
protected |
Definition at line 102 of file AbstractPdf.php.
|
protected |
Definition at line 35 of file AbstractPdf.php.
|
protected |
Definition at line 92 of file AbstractPdf.php.
|
protected |
Definition at line 82 of file AbstractPdf.php.
|
protected |
Definition at line 117 of file AbstractPdf.php.
|
protected |
Definition at line 112 of file AbstractPdf.php.
|
protected |
Definition at line 70 of file AbstractPdf.php.
$y |
Definition at line 26 of file AbstractPdf.php.
const XML_PATH_SALES_PDF_CREDITMEMO_PUT_ORDER_ID = 'sales_pdf/creditmemo/put_order_id' |
Definition at line 44 of file AbstractPdf.php.
const XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID = 'sales_pdf/invoice/put_order_id' |
Predefined constants
Definition at line 40 of file AbstractPdf.php.
const XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID = 'sales_pdf/shipment/put_order_id' |
Definition at line 42 of file AbstractPdf.php.