A barebones NodeJS API that will generate PDFs with the help of React PDF.
This repo was created for the tutorial How to Generate PDFs with NodeJS and React PDF.
npm install
npm run serve
To generate a PDF, send a JSON blob matching the expected data in the body of a POST request.
Using the default template, the JSON would look like this:
{
"companyName": "Blank Labs",
"companyPhone": "555-555-5555",
"companyEmail": "hello@blanklabs.dev",
"receiptNumber": "101445",
"datePaid": "1/4/2022",
"paymentMethod": "Visa",
"amount": "$29.99"
}
The PDF will be returned in the response of the POST request.