How to generate Pdf file from html data?


#1

Hi Guys,
I need to generate a pdf file with the available data in the view. I looked into the libraries like jsPDF, pdfkit, pdfmake. But none of the have proper documentation for Ionic 2. Is there any plugin/ library to generate pdf files in Ionic 2 with proper documentaion?
Thank you.


#2

I am also looking for it


#3

ionic is front end code, to accomplish a task such as creating PDF’s you need backend logic.

ideally you can use ajax to send your ionic data to your server which performs creates the HTML & then generates the pdf. I normally use phantomjs for pixel perfect HTML -> PDF creations


#4

You can generate pdf with pdfmake. refer following link. http://pdfmake.org/#/.