«Фавориты Успеха» logo TCPDF vs mPDF (quick overview)
© FAVOR.com.ua
 
TCPDF vs mPDF (quick overview)
  

TCPDF is the best tool to create booklet covers or non-template based PDFs. It’s excellently supports SVG, PNG and another graphic formats, however if you would like to generate PDF’s based on some HTML templates — it’s wrong tool :(

If you want to use HTML templates and create PDFs with look and feel of pure HTML pages — forget about TCPDF and use mPDF instead.

Unfortunately, development of mPDF has been suspended recently, but it’s still briliant in converting HTML to PDFwith full (or almost full) CSS3 support. However, unfortunately, mPDF doesn’t natively supports SVG format (I guess it uses GD-library for it), doesn’t allows to display SVGs with custom fonts, etc.

Unfortunately both major features (native SVG and HTML support) is crucial for me, so I decided to use both these libraries. I’m creating TCPDF to create the covers for my booklet, or some single pages with custom vector graphic (which I can modify on fly), and mPDF to create text reports, based on my HTML templates.

Actually, in some near future I could switch to mPDF completely, but it will happens if either, mPDF will have better support of custom graphic (including native support of SVG-format), or when Inkscape will allow to convert text-based SVGs to plain SVGs with outlined text. I guess this feature already implemented, but doesn’t released yet officially in stable release. So let’s wait for Inkscape 0.49... I hope to be able to modify text in SVG-files, export them to SVGs with outlined path using command-line Inkscape tool, then I will use outlined SVGs in mPDF.

Summary:

  • mPDF much more buggy than TCPDF. (TCPDF is extremely stable, it’s author Nicola Asuni very quickly fixes all found bugs, however reluctantly adding new features)
  • mPDF doesn’t support text and element strokes. (So, as it said above, if you would like to make some artwork, like booklet covers — use TCPDF instead.)
  • TCPDF doesn’t support normal HTML/CSS-rendering.

You decide what to use. I’m using them both.

https://favor.com.ua/ru/blogs/9592.html