0

I have a jsp page it contains HTML,jquery,few graphs using jqplot,

canvas elements ,images and tables with model attributes(from spring controller)

I could able to bring graphs in ie(6,7,8) using excanvas.js,My requirement is to generate

a pdf containing images,graphs,tables as in the jsp page on a button click

I Google for a while and could not find any,that is suitable for my requirement

Can anyone guide me from where i have to start.

Thanks.

user2779544
  • 429
  • 1
  • 8
  • 24
  • Libraries and resources are not a good topic for SO questions. Anyway didn't you find references for **iText** or **Apache FOP**? Whatevery you need to do...you can use them. – Adriano Repetti Dec 09 '13 at 13:05
  • @Adriano thanks for the suggestion ,is it possible to include graph generated in client browser in the pdf,i could only found examples on iText and Apache FOP creating pdf in server side – user2779544 Dec 09 '13 at 13:18
  • Of course because they work server-side. To include something modified on client side you have first to send data to server (via a normal AJAX call, for example). Server will do everything and send back PDF to client. – Adriano Repetti Dec 09 '13 at 13:24
  • @Andriano if then the only way is send the canvas content as image to the server get output as stream of type pdf,can you help me here i have tried **var canvas = $("#chartcanvas"); var img = canvas.toDataURL("image/png");** its giving object doesn't support this property error in ie – user2779544 Dec 09 '13 at 13:33
  • Which version of IE? I don't know if excanvas supports it – Adriano Repetti Dec 09 '13 at 14:07
  • @Adriano encanvas doesnt support toDataURL [here][http://stackoverflow.com/questions/19970525/convert-image-to-byte-code-in-javascript-ie8] – user2779544 Dec 09 '13 at 14:20
  • So you have to find another way to do it. For example sending DATA instead of an IMAGE (and replicating drawing logic server-side). Of course you may even doesn't support IE8 (and olders) for PDF download. That said I wouldn't send an image from client to server. You'll use a lot of bandwidth. – Adriano Repetti Dec 09 '13 at 14:21

0 Answers0