-
Notifications
You must be signed in to change notification settings - Fork 25
Eliminate usage of Zend_Pdf from Magento 2 Open Source #80
Comments
There are a few complexities around this piece of work:
Given this, my recommendation would be as follows:
|
Another idea I had was the possibility of rendering HTML for invoices, and then relying on the browser's print feature. Unfortunately, there are issues with the way browsers print that preclude this working without redesigning things. I've attached a simple invoice for reference, and had a play at recreating this on JSBin. The first problem I saw was that the browser will try to print a header and footer of its own, containing things like the printed URL, the time of printing, etc. This would be unsuitable, but a new feature of CSS allows this to be removed using the The second problem I found is that the browsers generally refuse to print dark backgrounds, as seen in the header. This too is fixable, but only in Webkit and Chrome with the prefixed -webkit-print-color-adjust. These issues are annoying, because they probably won't be issues in 18 months time, but we need a solution now, but in the long term, this would be a vastly preferable way of generating PDFs, since it hugely simplifies the process of customisation. |
In the meantime, basing a Magento standard API on the features available in However, given the above issues, it might be worth considering PHP 7.2 support with I'm going to do something else and wait for a response from somebody who can actually make decisions, though. |
This is a must if/when we change anything. IMO, as both @piotrekkaminski, what do you think about HTML-based PDF as @maxbucknell described above? |
And yes, we will go with |
Didn't try it out, but another lib that converts HTML to Pdf - https://github.com/dompdf/dompdf |
References count: 133
Used in EE/B2B: yes
Acceptance Criteria:
OR
(if only limited functionality of Zend_Pdf is used by M2
then not all dependencies may be required and some part of Zend_Pdf
still may be removed if has incompatibility with PHP 7.2)
The text was updated successfully, but these errors were encountered: