title: Django ReportLab: using Drawing object to create PDF and return via Httpresponse
body: <p>In ReportLab, Drawing object can be written into different renderers, e.g </p>
  
  <pre><code>d = shapes.Drawing(400, 400)
  renderPDF.drawToFile(d, 'test.pdf')
  </code></pre>
  
  <p>and in Django, Canvas object can be sent via httpresponse, e.g.:</p>
  
  <pre><code>response = HttpResponse(mimetype='application/pdf')
  response['Content-Disposition'] = 'filename=test.pdf'
  c = canvas.Canvas(response)
  </code></pre>
  
  <p>in my case, my problem is that I have a reportLab script using Drawing object which saves to local file system. I now put it in Django views, and wondering whether there is a way to not save to local file system but instead sent back to client.</p>
  
  <p>I hope I describe this question clearly.</p>
  
  <p>Thanks for any advice!</p>
  
  <p><strong>updates</strong></p>
  
  <p>it turns out there is a function in renderPDF:</p>
  
  <pre><code>renderPDF.draw(drawing, canvas, x, y)
  </code></pre>
  
  <p>which can render drawing() object in the given canvas.</p>