PHP PDF Generator Advice

Can anybody advise on the best PDF generator class/library to use with PHP? Preferably one which is maintained.

I am aware that this is a duplicate of the following question, however, the accepted answer is over 3 years old and I want to know whether the answer has changed since this time.

Which one is the best PDF-API for PHP?

Thank you

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Try TCPDF, have good features

Also simple HTML to PDF Converter API in (PHP, C#, C#, ASP, JAVA,…)

from “PDF CROWD”

very simple to use, but I think this API may need to purchase even they provide a free test account..

Solution 2

Have you tried

Provides a powerful template engine, and is pretty easy to use.

Supports complex layouts, layouts for multiple pages, invoices spreading separate pages, pagenumbers, headers, footers, etc. Definitively much better than fpdf.

You can simply integrate it into your PHP code by:

generatePdf(<templateName>, <ParameterArray>);

very straightforward.

Solution 3

Have a look on Convert HTML to PDF using WebKit engine.
It can be used from PHP easily. For example, there is a bundle for Symfony2:

Solution 4

Best One is TCPDF

Never Use DOMPDF

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply