In ReportLab, a Drawing object can be written to different renderers, for example
d = shapes.Drawing(400, 400)
renderPDF.drawToFile(d, 'test.pdf')
and in Django, a Canvas object can be sent via httpresponse, for example:
response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'filename=test.pdf'
c = canvas.Canvas(response)
in my case, my problem is that I have a reportLab script using the Drawing object, which is saved on the local file system. Now I put it in Django views and wonder if there is a way not to save on the local file system, but instead send it back to the client.
I hope I will clearly describe this issue.
Thanks for any advice!
Updates
It turns out that renderPDF has a function:
renderPDF.draw(drawing, canvas, x, y)
which can display the drawing () object in this canvas.
Simon