This app is a simple example to use https://github.com/marcbachmann/node-html-pdf
First you have to install the packages using:
npm install
Then simply
node .
You have to supply two queries, name
and html
for example:
localhost:3000/?name=mypdf&html=<h1>Hello World!</h1>
You have to supply in the body, name
and html
for example:
POST /post HTTP/1.1
Host: localhost:3000
Content-Type: application/x-www-form-urlencoded
html=<div>Hello World</div>&name=mypdf
with cURL
:
curl --location --request POST 'localhost:3000/post' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'html=<div>Hello World</div>' \
--data-urlencode 'name=mypdf'