I need to create a PDF file from existing clean HTML files when I click the Export button. Since I am working on a php project, a solution that can be easily used in a java project may be preferable.
Thanks for all the answers.
I'm not sure how well it integrates into PHP, but I use pandoc for all kinds of document conversion. It can process HTML to PDF.
http://johnmacfarlane.net/pandoc/
You can use this library: html2pdf or this dompdf
Possible solution, http://wkhtmltopdf.org/ This works very well for other html documents that I used