mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-09 17:12:14 +01:00
* adding URL conversions * updating gotenberg version in documentation * pkg: input as variadic string (#39) * pkg: input as variadic string * pkg: fix link to github doc * update doc about v4 client * make doc * fixing missing variadic inputs in doc * adding more fonts * updating PHP documentation
35 lines
800 B
Markdown
35 lines
800 B
Markdown
# Gotenberg Go client
|
|
|
|
A simple Go client for interacting with a Gotenberg API.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
$ go get -u github.com/thecodingmachine/gotenberg
|
|
```
|
|
|
|
## Usage
|
|
|
|
```golang
|
|
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(
|
|
"font.woff",
|
|
"img.gif",
|
|
"style.css",
|
|
)
|
|
req.SetPaperSize(gotenberg.A4)
|
|
req.SetMargins(gotenberg.NormalMargins)
|
|
req.SetLandscape(false)
|
|
dest := "foo.pdf"
|
|
c.Store(req, dest)
|
|
}
|
|
```
|
|
|
|
For more complete usages, head to the [documentation](https://thecodingmachine.github.io/gotenberg). |