https://github.com/adrianhajdin/tutorial_pdf_generation
This is a code repository for the corresponding article on Medium. In this tutorial, you will learn how to generate dynamic PDFs using HTML code as a template.
https://github.com/adrianhajdin/tutorial_pdf_generation
article tutorial-code
Last synced: about 2 months ago
JSON representation
This is a code repository for the corresponding article on Medium. In this tutorial, you will learn how to generate dynamic PDFs using HTML code as a template.
- Host: GitHub
- URL: https://github.com/adrianhajdin/tutorial_pdf_generation
- Owner: adrianhajdin
- Created: 2019-01-27T08:25:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T20:44:42.000Z (about 6 years ago)
- Last Synced: 2025-04-08T02:43:14.552Z (3 months ago)
- Topics: article, tutorial-code
- Language: JavaScript
- Homepage:
- Size: 192 KB
- Stars: 123
- Watchers: 4
- Forks: 86
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Generate Dynamic PDFs Using React and NodeJS
## Currency Converter Tutorial
This is a code repository for the corresponding [article](https://medium.freecodecamp.org/how-to-generate-dynamic-pdfs-using-react-and-nodejs-eac9e9cb4dde) on Medium.
In this tutorial, you will learn how to generate dynamic PDFs using HTML code as a template.
## Project Setup
1. Create a new directory
```mkdir pdfGenerator && cd pdfGenerator```
2. 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```
3. 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.
4. Add proxy inside of client/package.json, above the dependencies, simply add ```“proxy”: “http://localhost:5000/"```, so you can call the localhost from the client.
5. Open two different terminals:
First one: go into the client directory and ```run npm start```
Second one: go into the server directory and ```run nodemon index.js```