I have a java Application which view few results in a web page , I want to save those results into PDF file which user click on a button "Export to PDF" Button. Can any one please help me to use which technology. I am really aware of this.
-
programmers.stackexchange.com/questions/152470/…HIRA THAKUR– HIRA THAKUR2013-11-05 05:47:22 +00:00Commented Nov 5, 2013 at 5:47
-
possible duplicate of convert HTML ( having Javascript ) to PDF using java / javascriptHIRA THAKUR– HIRA THAKUR2013-11-05 05:47:42 +00:00Commented Nov 5, 2013 at 5:47
-
This is not the duplicate question.. Probably it might be posted my different user..Navyah– Navyah2013-11-05 06:02:04 +00:00Commented Nov 5, 2013 at 6:02
Add a comment
|
1 Answer
The simple and best way is to make use of existing libraries. You can get it done either in server side or in client side. If you choose the server side, go for iText PDF Api Otherwise you can use jspdf. Both will provide their own methods, you could use it.
3 Comments
Navyah
I am looking into JspDF file . this shows how to save the file file into PDF with static text in it.. Can u please help me in showing sample codes to store the web page into pdf when user click on button
Ayyappan Sekar
make use of .fromHTML() method which helps writing HTML contents into pdf file. I couldnt find the exact docs for it. But can you can find some examples by googling it !!!
Dynamic
I spent a day on JSPDF. It doesn't support CSS file references. It also doesn't support multipages. I added Html2Convas, it solved the CSS issue. But found no solution for multipages. gave up on it!