pdf = renderPDF.drawToString(drawing)
response = HttpResponse(mimetype='application/pdf')
response.write(pdf)
response['Content-Disposition'] = 'attachment; filename=converted.pdf'
return response
Generating PDFs from SVG input