Commit ad2a69bf by jomenxiao

add encoding param

parent 0506cfdc
......@@ -24,6 +24,7 @@ func RenderToPng(c *middleware.Context) {
OrgId: c.OrgId,
Timeout: queryReader.Get("timeout", "60"),
Timezone: queryReader.Get("tz", ""),
Encoding: queryReader.Get("encoding", ""),
}
pngPath, err := renderer.RenderToPng(renderOpts)
......
......@@ -27,6 +27,7 @@ type RenderOpts struct {
Timeout string
OrgId int64
Timezone string
Encoding string
}
var ErrTimeout = errors.New("Timeout error. You can set timeout in seconds with &timeout url parameter")
......@@ -95,6 +96,10 @@ func RenderToPng(params *RenderOpts) (string, error) {
"renderKey=" + renderKey,
}
if params.Encoding != "" {
cmdArgs = append([]string{fmt.Sprintf("--output-encoding=%s", params.Encoding)}, cmdArgs...)
}
cmd := exec.Command(binPath, cmdArgs...)
stdout, err := cmd.StdoutPipe()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment