mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 08:32:16 +01:00
790 B
790 B
Gotenberg Go client
A simple Go client for interacting with a Gotenberg API.
Install
$ go get -u github.com/thecodingmachine/gotenberg
Usage
import "github.com/thecodingmachine/gotenberg/pkg"
func main() {
// HTML conversion example.
c := &gotenberg.Client{Hostname: "http://localhost:3000"}
req, _ := gotenberg.NewHTMLRequest("index.html")
req.SetHeader("header.html")
req.SetFooter("footer.html")
req.SetAssets([]string{
"font.woff",
"img.gif",
"style.css",
})
req.SetPaperSize(A4)
req.SetMargins(NormalMargins)
req.SetLandscape(false)
dest := "foo.pdf"
c.Store(req, dest)
}
For more complete usages, head to the documentation.