Effective PDF Generation in Drupal

I’ve been battling this issue for years. I started with htmldoc, and then went to wkhtmltopdf. While the second was better than the first, both of them require setting up a binary on the server which means that the code is not portable, especially in a shared hosting environment.
I then tried PhantomJS, which is better again, and you can install the binary as part of your source tree, however it still isn’t all that great.

Which brings us to PHP libraries.
DomPDF had various issues, I struggled to get it working properly (as you did).

What I’m using now is mpdf, which I’ve found to be fantastic. It supports CSS properly (unlike wkhtmltopdf), is totally portable with your codebase, and to be honest I haven’t found any issues with it. It just works really well.

I’d really recommend trying it out.