1

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.enter image description here

1

3 Answers 3

2

It is highly inefficient to do this client-side(via Javascript). You should consider doing it server-side(using PHP, ASP/.NET or such). PHP uses a service called iTextSharp for this, PHP uses DOMPDF.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Amazing project, but saving the whole page as pixel data will be highly inefficient and create bigger PDF files than needed.
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 :-)
0

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

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.
But this does not solve my prob of images being converted to a PDF file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.