0

I've been looking around for a good HTML to PDF converter via PHP. But all the information I've gathered is from 2010 or earlier which gives distorted image in my opinion because ever since those libraries were made or used or whatever, HTML5 and CSS3 wasn't in the picture yet. So now I'm wondering which library is nowadays still working flawless and is worth trying out.

I've found a couple of libraries and I was wondering if these are good enough these days but if you have another example, library or script. Please do tell

  • DOMPDF
  • mPDF
  • fPDF (don't think this one is an option but I've seen a lot of scripts using fPDF as foundation)
  • HTML2PDF and HTML2PS

Thanks in advance!

Bart Scheffer
  • 497
  • 1
  • 3
  • 18
  • I used mPDF couple of times. It is really fast and easy to use. – barell Mar 26 '14 at 21:14
  • Possible duplicate of [Convert HTML CSS to PDF with PHP](http://stackoverflow.com/questions/391005/convert-html-css-to-pdf-with-php) – larsAnders Mar 26 '14 at 21:16
  • Okay thanks but do you think this one is still a good converter? Because I also need to use images and a couple of css classes – Bart Scheffer Mar 26 '14 at 21:16
  • fPDF is very fast and very easy to use, but it's not an HTML to PDF converter; it's for building PDF documents from scratch. – Kryten Mar 26 '14 at 21:16
  • @larsAnders Yes it is, but since I've seen posts in that topic from 08 I was curious if there were any changes since then and if there are nowadays more modern variations – Bart Scheffer Mar 26 '14 at 21:19
  • Here is another good one: http://wkhtmltopdf.org – effone Mar 26 '14 at 21:20
  • @Kryten If there is enough room for styling your document I'd give it a try but I'm not sure you can – Bart Scheffer Mar 26 '14 at 21:39

1 Answers1

1

You might want to try using phantomjs headless browser with some PHP library of your choice.

Jakub Fedyczak
  • 2,174
  • 1
  • 13
  • 15