0

I have a web application with some pages where there are some texts, and some charts generated with javascript library. I want to show a "Download as pdf" link on each page, which will export the current page in pdf version.

Is there any way to do this.?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Rajan
  • 1,501
  • 4
  • 21
  • 37
  • I think the below link help you. http://stackoverflow.com/questions/1686280/convert-html-having-javascript-to-pdf-using-java-javascript – Janny Sep 22 '14 at 10:58

3 Answers3

1

http://www.cloudformatter.com/CSS2Pdf has 12 different chart/map javascript libraries in the demos panel showing the pure SVG to PDF as vector information along with text, tables.

Kevin Brown
  • 8,805
  • 2
  • 20
  • 38
  • CSS2Pdf doesn't seem to support jqPlot as of now. Is it possible to export jqPlot charts somehow in PDF? – Manish Mar 12 '15 at 19:09
  • 1
    CSS2Pdf does not have built-in support in the Javascript for canvas, it does for SVG. You would need to implement something in the process that does canvas to image and send the image inside the HTML to the formatter. – Kevin Brown Mar 13 '15 at 17:35
0

http://phantomjs.org/

Just run from command line

phantomjs rasterize.js 'http://en.wikipedia.org/w/index.php?title=Jakarta&printable=yes' jakarta.pdf
cevek
  • 862
  • 1
  • 7
  • 16
0

You can export image, then insert it into pdf file using itext or another library. I think the below link help you: http://www.highcharts.com/component/content/article/2-articles/news/56-improved-image-export-with-phantomjs