"there is no library which can handle html code that well" - so leave it to a tried and tested rendering engine like I suggest.
Hi, i am not familiar with anything of pdf library, but use fpdf seem hard code to me, because everything need to create first, dompdf seem easy than fpdf but lot of security risk, and now i want to see another alternative e.g. tcpdf, html2pdf (html2pdf.fr/en/default) or wkhtmltopdf does someone have experience with? thanks for you suggestions
The big problem is, that there is no library which can handle html code that well.
dom-pdf is a very good one, but have still huge problems with nested tables an page breaks. for your reason it should do the trick, I guess. It can also handle css a bit.
dompdf is fairly straight-forward to use. There is one security issue, but it is dependent on your configuration and fairly easy to work around (as helle mentioned). Plus, it would be easy to convert your invoice by just passing in the URL for the invoice.
for dom-pdf you have a link from kinjal above. and fpdf you have already found.
if it is a matter of time, i gues you'll need same time for setting up one of the later suggestions, and finding into the fpdf-class. hint for that: concentrate on multi-cell rather than cell.
if you can create the table yourself, I strongly recommend using fpdf. you will not be able to handle any css, but there are many formatting possibilities with fpdf.
to the security issue:
To resolve the security issue of DOMPDF, all that is needed is to modify DOMPDF slightly to only function in cgi mode, preventing any access from external sources and only able to be called from your application.