You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c := wkhtmltoimage.ImageOptions{BinaryPath: "-",Input: "/templates/email.gohtml", Format: "png"}
out, err := wkhtmltoimage.GenerateImage(&c)
if err!=nil{
fmt.Println(err.Error())
}
f, _ := os.Create("/templates/example.png")
defer f.Close()
n2, _ := f.Write(out)
fmt.Printf("wrote %d bytes\n", n2)
i got slice out of bound error can someone please me help me why i got this
The text was updated successfully, but these errors were encountered:
Edited:
Turns Out in GenerateImage function line 68 output, err := cmd.CombinedOutput()
return empty byte slice
So trimmed := cleanupOutput(output, options.Format)
will produce unhandled error
I make a little modification
c := wkhtmltoimage.ImageOptions{BinaryPath: "-",Input: "/templates/email.gohtml", Format: "png"}
out, err := wkhtmltoimage.GenerateImage(&c)
if err!=nil{
fmt.Println(err.Error())
}
f, _ := os.Create("/templates/example.png")
defer f.Close()
n2, _ := f.Write(out)
fmt.Printf("wrote %d bytes\n", n2)
i got slice out of bound error can someone please me help me why i got this
The text was updated successfully, but these errors were encountered: