Reputation: 272
I have requirement to convert a web page into pdf using java or javascript. This pdf should exactly look like print format of webpage. So basically I have to print the html webpage into pdf doc using java or javascript
Upvotes: 2
Views: 2855
Reputation: 16060
Try http://code.google.com/p/flying-saucer/
But it is impossible to create an exactly equal looking pdf. There is no support for scrollabars in PDF. especially, if the PDF should be printed.
Upvotes: 0
Reputation: 15890
I suggest wkhtmltopdf. It uses webkit to render HTML to PDF. Snazzy.
PS: "exactly" is a rather fickle concept in HTML. "Pixel perfect" simply won't happen.
Upvotes: 1