Sign inSign up

dacinfomotion/h2p

By dacinfomotion

•Updated over 1 year ago

Simple service for converting HTML to PDF

Image
0

1.5K

dacinfomotion/h2p repository overview

⁠Simple service for converting HTML to PDF

⁠Quick Start

version: '3.8'

services:
  h2p:
    image: admindacdockerhub/h2p:latest
    container_name: h2p
    ports:
      - "3000:3000"
    restart: unless-stopped
⁠Configuring generated PDF

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⁠

⁠Example of the basic post request
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>"
}'
⁠Example of the basic post request with pdf options
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"
        }
    }
}'

Tag summary

Content type

Image

Digest

sha256:68fa393b4…

Size

697.4 MB

Last updated

over 1 year ago

docker pull dacinfomotion/h2p