cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice, shipment, credit memo PDFs: Remove Zend_Pdf, replace with html2pdf tool

Invoice, shipment, credit memo PDFs: Remove Zend_Pdf, replace with html2pdf tool

Given that the current invoice, shipment and credit memo PDFs look the same as in Magento 1 and PDF's are always a bit of a nightmare to customize for the merchants:

I suggest to replace the PDFs with a html2pdf tool. Actually the preview of the invoice looks already really nice in the backend, so this could just be converted to pdf.

 

This would maybe also help the problem Hirokazu Nishi mentioned in his tweet:

"Magento2 still use LinLibertine font. It’s only for Alphabets. To change PDF font, we still have to rewrite some classes..."

 

This idea resulted from a tweet/discussion here:

https://twitter.com/hirokazu_nishi/status/770282916819578881

https://twitter.com/rescueAnn/status/770338589326635008

https://twitter.com/benmarks/status/770339381995384832

 

(6)
6 Comments
Magento Master

Yes please! At the company I work for we've built an implementation with H4CC Wkhtmltopdf and Snappy php wrapper.

It works brilliantly and isn't too heavy on the server.

 

Also built in a caching layer saving the PDFs to S3 but that's just being fancy Smiley Wink

 

Right now in Magento 1 we've implemented the PDF's as the emails, with local templates and a variable engine generating the HTML, the actual PDF renderer (snappy) is ambiguous

M2 Certified
+1 this would be a vast improvement over the current implementation
Magento Master

It's not only font file. Printing some characters that consist of both single-byte and double-bytes, we have to calcluate each words width correctly. Otherwise they are sticking out from rectangle area!

And also Zend_Pdf can't generate PDF files without font file. So multibyte PDF (especially Chinese and Japanese) becomes huge size. 

Magento Master

Just found another case where someone would be happy about a HTML invoice PDF:
http://magento.stackexchange.com/questions/154693/magento2-html-invoice

 

New Contributor

Hello all,

 

We have created https://github.com/EaDesgin/magento2-pdf-generator2 some time ago. Maybe will help somebody. 

Also supports right left  and asian fonts and languages but they are not implemented not implemented. 

Occasional Contributor

 

Magento 2 PDF Customizer ← We have a solution Smiley Happy

 

With this extension, you can make flexible HTML+CSS so to create PDF templates. 

 

Features:

  • Support of HTML and CSS
  • Bulk printing of orders/invoices/shipments/credit memos/all
  • Admin, customer and guest PDF templates
  • Attach PDF files to sales emails
  • Free installation & free lifetime support

 

screenshot-1_1_4.png