PDF-Output: str/bytes handling fix
This commit is contained in:
5
app.py
5
app.py
@@ -399,8 +399,11 @@ def invoice_pdf():
|
||||
pdf.ln(6)
|
||||
pdf.cell(180, 4, "Zahlbar innerhalb von 14 Tagen ohne Abzug. Vielen Dank fur Ihren Auftrag!")
|
||||
|
||||
pdf_out = pdf.output(dest='S')
|
||||
if isinstance(pdf_out, str):
|
||||
pdf_out = pdf_out.encode('latin-1')
|
||||
return send_file(
|
||||
io.BytesIO(pdf.output(dest='S').encode('latin-1')),
|
||||
io.BytesIO(pdf_out),
|
||||
mimetype='application/pdf',
|
||||
as_attachment=True,
|
||||
download_name='rechnung.pdf'
|
||||
|
||||
Reference in New Issue
Block a user