Log in
Model

AbstractPdf

Magento\Sales\Model\Order\Pdf\AbstractPdf

What it does

This abstract base class provides core functionality for generating PDF documents for sales orders, invoices, shipments, and credit memos in Magento 2.

Developers extend this class when creating custom PDF templates or modifying the layout and content of sales-related PDF documents.

It handles PDF page creation, text formatting, address insertion, payment/shipping information rendering, and item drawing using Zend_Pdf.

Public Methods

  • getPdf()
  • widthForStringUsingFontSize()
  • getAlignRight()
  • getAlignCenter()
  • insertDocumentNumber()
  • getRenderer()
  • newPage()
  • drawLineBlocks()