Add --format parameter to WeasyPrint
Apparently, in older version of WeasyPrint it was possible to output either PNG or PDF, so they had that parameter. In more recent versions, the only acceptable is PDF, but they removed the fucking parameter between versions 51 and 52, to it _will_ fail in recent version of WeasyPrint. For now, i am using the same version that Debian 11 does, and let’s hope it stays like this a long time. (It won’t, of course, but well….)
This commit is contained in:
parent
4d2379555e
commit
c1a64dd51d
|
@ -81,7 +81,7 @@ func ServeInvoice(w http.ResponseWriter, r *http.Request, params httprouter.Para
|
|||
return
|
||||
}
|
||||
if pdf {
|
||||
cmd := exec.Command("weasyprint", "--stylesheet", "web/static/invoice.css", "-", "-")
|
||||
cmd := exec.Command("weasyprint", "--format", "pdf", "--stylesheet", "web/static/invoice.css", "-", "-")
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
stdin, err := cmd.StdinPipe()
|
||||
|
|
Loading…
Reference in New Issue