Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java convert html with css+js to pdf [closed]

I am developing a JSF project and I have a doubt about reporting.

The idea is to offer the users reports in both HTML and PDF formats.

This should work developing the reports in HTML+CSS+JS and whenever a user needs a PDF report just convert the HMTL+CSS+JS to PDF.

Does somebody know a free Java library for converting the HTML to PDF? This should be blind to the user.

Other proposals are accepted.

Thanks in advance.

like image 493
antonio_Developer Avatar asked Dec 20 '22 21:12

antonio_Developer


2 Answers

better to use wkhtmltopdf tool to convert your HTML to pdf

like image 89
shreyansh jogi Avatar answered Jan 01 '23 21:01

shreyansh jogi


Free solution: wkhtmltopdf - uses WebKit under the hood.

Commercial solution: PrinceXML - uses it's own ACID 2 compliant HTML rendering engine.

like image 43
Andrey Chaschev Avatar answered Jan 01 '23 23:01

Andrey Chaschev