Sign inSign up

farhansyah/html-to-pdf

By farhansyah

•Updated about 3 years ago

A standalone, fast, and portable HTML to PDF generator.

Image
0

421

farhansyah/html-to-pdf repository overview

⁠Docker Image

You can run it directly:

docker run -p 3000:3000 farhansyah/html-to-pdf

⁠Usage

Send a HTTP POST request with the body:

{
  "content": "<h1>Your content here</h1>",
  "options": {
    "format": "A4",
    "margin": {
      "top": 10,
      "left": 10
    }
  }
}

⁠Parameters

KeyTypeDescription
contentstring (required)Any HTML string will do. Most of the time, you'll get the PDF exactly as you see in your browser. You can use css class and styles in it.
optionsPuppeteer.PDFOptions⁠ (optional)You can pass the options to configure the Puppeteer page

⁠Environment Value

KeyDescription
CONCURRENCYpuppeteer-cluster concurrency⁠ options -> 1:PAGE, 2:CONTEXT, 3:BROWSER. Default: 2
MAX_CONCURRENCYMax concurrency number. (Max number of tabs/pages). Default: 5

Tag summary

Content type

Image

Digest

sha256:4bcc14ca5…

Size

341.2 MB

Last updated

over 3 years ago

docker pull farhansyah/html-to-pdf