title: django pdf with logo image
body: <p>I have created Invoice Pdf text template using pisa. But I want to display logo(image) in the pdf file along with the text. I dont know how to display image in pdf. My views as follows:</p>
  
  <pre><code>def generate_invoice(request, user_id = None):
      personal_html = ''
      personal_html += 'hai'
  
      fileread = str(settings.TEMPLATE_DIRS[0])+str('/invoice.html')
      fr = open(fileread, "r").read()
      fr = fr.replace('personal_details', personal_html)
      result = StringIO.StringIO()
      pdf = pisa.CreatePDF(
                          fr,result
                          )
      filewrite = str(settings.TEMPLATE_DIRS[0]) + str('/invoice_write.html')
      empty = ""
      fw = open(filewrite, 'w')
      fw.write(empty)
      fw.write(fr)
      fw.close()
      PaymentPdf.objects.filter(invoicepdf = user_id).delete()
      pdf_contents     = render_to_pdf1('invoice_write.html',result)
      file_to_be_saved = ContentFile(pdf_contents)
      random_str       = ''.join(random.sample((string.ascii_lowercase + string.ascii_uppercase + string.digits), 8))
      resume_name      = (str(user_id) + "_" + random_str + ".pdf").replace("@", '')
      resume           = PaymentPdf.objects.create(name = resume_name, invoicepdf_id = user_id, created_by = request.user)
      resume.name.save(resume_name ,file_to_be_saved)
      file_path = PaymentPdf.objects.get(invoicepdf = user_id).name
      pdf_file = str(file_path).split("media")[1]
      return HttpResponseRedirect('/site_media' + pdf_file)
  
  def render_to_pdf1(template_src, context_dict):
      template = get_template(template_src)
      context  = Context(context_dict)
      html     = template.render(context)
      result   = StringIO.StringIO()
      pdf      = pisa.pisaDocument(StringIO.StringIO(html.encode("ISO-8859-1")), result)
      return result.getvalue()
  </code></pre>
  
  <p>Anyone help me to display image in pdf?</p>