Search code examples
javascriptnode.jspdfgraphamcharts

How to import html page as pdf in nodejs


I have an html page which contains graph created with Amcharts and I need to generate pdf of my html page. Amcharts have provided this link for exporting html in javascript my question is there is any way to export a page from server-side i.e nodejs.

There is no such tutorial in a given site and so far I have tried phantomjs plugin but it didn't help.


Solution

  • Amcharts has a knowledgebase article showing how to do this. If you prefer an alternative you can try pdfmake and build up the pdf with the png's yourself.

    Once you have the pdf you can serve the file over an endpoint on node pretty easily, eg using express.