Simple service for converting HTML to PDF
1.5K
version: '3.8'
services:
h2p:
image: admindacdockerhub/h2p:latest
container_name: h2p
ports:
- "3000:3000"
restart: unless-stopped
To adjust generated pdf to your needs please send proper options inside the body of your post request. To accomplish this, please follow JSON object format mentioned in the official puppeteer docs: https://devdocs.io/puppeteer/index#pagepdfoptions
curl --location --request POST 'http://localhost:3000/print' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "ExampleRoute",
"html": "<html><body><h1>My first Heading</h1><p>My first paragraph.</p></body></html>"
}'
curl --location --request POST 'http://localhost:3000/print' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "ExampleRoute",
"html": "<html><body><h1>My first Heading</h1><p>My first paragraph.</p></body></html>",
"options":
{
"margin":
{
"top": "35px",
"right": "35px",
"left": "35px"
}
}
}'
Content type
Image
Digest
sha256:68fa393b4…
Size
697.4 MB
Last updated
over 1 year ago
docker pull dacinfomotion/h2p