High-performance document generation API. Generate documents and reports from СSV, JSON, XML with 99,9% uptime and 24/7 monitoring.
import (
"github.com/blazingdocs/blazingdocs-go"
"github.com/blazingdocs/blazingdocs-go/config"
)
go get -u github.com/blazingdocs/blazingdocs-go
You can get your API Key at https://app.blazingdocs.com
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
resp, err := client.GetAccount()
var s string
tempResp, tempErr := client.GetTemplates(s)
usageResp, usageErr := client.GetUsage()
file, _ := ioutil.ReadFile("../PO-Template.json")
s := string(file)
params := parameters.MergeParameters{
DataSourceName: "data", // data source name
DataSourceType: utils.JSON_TYPE, // data in json format
Strict: true, // keep json types
ParseColumns: false, // true if data is csv file with column names
Sequence: false, // data is object
}
ffile, _ := os.Open("../PO-Template.docx")
formFile := utils.FormFile{
Name: "PO-Template.docx",
Content: ffile,
}
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
resp, err := client.MergeWithFile(s, "output.pdf", params, formFile)
See more details here https://docs.blazingdocs.com