-3

I am working on react ja project which is contains pdf file download. I have list view which is contains some get service data from the api, exactly on the list view I have download button. If I click on the download button the list view should download as pdf file.

I have no idea how to that, so how to generate pdf file in react js?

steve
  • 95
  • 1
  • 2
  • 5
  • I haven't done this on the client side, but I just wrote a little script using pdfkit. Have a poke around http://pdfkit.org/, might help get you started. – adam.k Oct 03 '18 at 06:44
  • Google is your friend: https://github.com/diegomura/react-pdf client side generation of PDFs – Jayce444 Oct 03 '18 at 06:47
  • check this once https://stackblitz.com/edit/react-4798tj – Jayavel Oct 03 '18 at 06:57

1 Answers1

0

There are two older answers for this in stackoverfow.

First one is this. How to make PDF from React?

Second one is how to use jsPDF properly. And there is a working jsfiddle example allso. Refer them. How to properly use jsPDF library

GunarathneMDD
  • 180
  • 1
  • 2
  • 11