html2pdf

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0

README

Build status

What?

A small microservice that turns HTML into a PDF file. You can run this:

  • on AWS Lambda
  • with Docker
    • I didn't bother making a Dockerfile though, since I didn't need it. PR welcome!
  • as a standalone binary

There also exists a small client library for Go

Testing

You can start a local server process with:

$ html2pdf server

Then call it from the client:

$ export HTML2PDF_TOKEN="doesntMatter" # optionally you can put the service behind authentication
$ html2pdf client-localhost '<h1>hello world</h1>' > out.pdf

Usage from curl is also simple:

$ curl -d '{"html_base64": "PGgxPmhlbGxvIHdvcmxkPC9oMT4="}' http://localhost/render > out.pdf

Prerequisites for dev/testing

$ apt install -y libxrender1 libxext6 libfontconfig1

(Fortunately, these exist in Lambda's AMI)

Alternatives

Support / contact

Basic support (no guarantees) for issues / feature requests via GitHub issues.

Paid support is available via function61.com/consulting

Contact options (email, Twitter etc.) at function61.com

Directories

Path Synopsis
cmd
html2pdf command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL