In my html5 hybrid iPad application i am generating a report in one of the pages . What i want is to generate a PDF file of that report and save it in ipad.Please help me with this. I am using JavaScript and mobile jQuery for this.
-
mattgemmell.com/2008/12/08/what-have-you-triedJakub Konecki– Jakub Konecki2012-06-15 10:07:16 +00:00Commented Jun 15, 2012 at 10:07
Add a comment
|
3 Answers
If you want to it with Javascript, http://html2canvas.hertzen.com/ is the best tool you will find! It uses the DOM style to generate an image. The only thing you need to do is then wrap it in a PDF. Have a look at their examples! For example:
http://html2canvas.hertzen.com/examples/artificial/index.html
2 Comments
pixelistik
Amazing project, but saving the whole page as pixel data will be highly inefficient and create bigger PDF files than needed.
Willem Mulder
True, but it might very well be possible to e.g. not render the text as pixels but insert it as real text. It would require some hacking though, but good projects deserve a follow-up :-)
You can use an open-source library for generating PDF documents, I have already use this library and works fine: http://code.google.com/p/jspdf/
Try it, I hope that is what you want
2 Comments
MobileHybridDev
Thanx for the answer but i have already tried this . the prob i face with this is that i am unable to append the whole data (which i am getting dynamically ) which also has images and generate the pdf.
MobileHybridDev
But this does not solve my prob of images being converted to a PDF file.