Magento uses the Zend_Pdf library to generate PDFs for order, invoice etc. This makes it really difficult to modify the PDF template without writing preferences to the actual classes and doing pixel-specific calculations
Proposed Solution
The PDFs should be rendered from HTML using any tool like dompdf to convert the HTML to PDF. This HTML should again, be using a layout handle, like order_invoice_pdf where the current invoice should be passed as a Registry Item, making it a lot easier to modify the PDFs
Preconditions
Magento 2.x
Problem
Magento uses the Zend_Pdf library to generate PDFs for order, invoice etc. This makes it really difficult to modify the PDF template without writing preferences to the actual classes and doing pixel-specific calculations
Proposed Solution
The PDFs should be rendered from HTML using any tool like dompdf to convert the HTML to PDF. This HTML should again, be using a layout handle, like
order_invoice_pdf
where the current invoice should be passed as a Registry Item, making it a lot easier to modify the PDFs