Create an Express server with mkdir server & cd server & touch index.js & npm init press enter a couple of times to initialize package.json and then run npm i -S express body-parser cors html-pdf to save all the necessary dependencies.
Create a new React App with create-react-app client and then move into newly created directory and install dependencies cd client & npm i -S axios file-saver.
Create a new directory mkdir pdfGenerator & cd pdfGenerator.
Link of the video: Generate Dynamic PDFs Using React and Node JS Project Setup I advise you to first glance over the article, code along with the video and then read the article.
Sending data from the client to the server and returning generated PDF.Īlong with writing this article, I have also created a YouTube video! You can follow along and code while watching.
Setting the project up with CRA and creating a simple Express server.