title: html template to pdf with images
body: <p>I am using django and trying to render invoice pdf, pdf is generating successfully but images are not in pdf.</p>
  
  <p>Actually I want to add barcode image, so I dynamically generated a <code>.svg</code> file, but don't know how to put it into pdf.</p>
  
  <p>Here is what I am doing ..</p>
  
  <pre><code>from io import BytesIO
  from django.http import HttpResponse
  from django.template.loader import get_template
  
  from xhtml2pdf import pisa
  
  def render_to_pdf(template_src, context_dict={}):
      template = get_template(template_src)
      html  = template.render(context_dict)
      result = BytesIO()
      pdf = pisa.pisaDocument(BytesIO(html.encode("ISO-8859-1")), result)
      if not pdf.err:
          return HttpResponse(result.getvalue(), content_type='application/pdf')
      return None
  </code></pre>
  
  <p>html - </p>
  
  <pre><code>  &lt;body&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-6"&gt;
            &lt;div class="row"&gt;
              &lt;div class="col-12"&gt;
                &lt;span&gt;
                  {{ package_no_barcode }}
                  &lt;br&gt;
                  {{ package.package_no }}
                  ....
  </code></pre>
  
  <p>view - </p>
  
  <pre><code>class GenerateInvoicePdf(View):
      def get(self, request, *args, **kwargs):
          package = Package.objects.get(package_no=request.GET.get('package'))
          address = package.purchase.order_product.delivery_location
          CODE128 = barcode.get_barcode_class('code128')
          package_no_barcode = CODE128(u'{pkg_no}'.format(pkg_no=package.package_no))
          if request.user.display_username == seller.display_username:
              data = {
                   'package':package,
                   'address':address,
                   'package_no_barcode':package_no_barcode,
               }
              pdf = render_to_pdf('pdf/invoice.html', data)
              if pdf:
                  response = HttpResponse(pdf, content_type='application/pdf')
                  filename = "Invoice_%s.pdf" %(package)
                  content = "inline; filename='%s'" %(filename)
                  download = request.GET.get("download")
                  if download:
                      content = "attachment; filename='%s'" %(filename)
                  response['Content-Disposition'] = content
                  return response
          return HttpResponse("Not found")
  </code></pre>
  
  <p>I also tried with cid - <code>&lt;img src="cid:{{ package_no_barcode }}" alt="{{ package.package_no }}"&gt;</code></p>
  
  <p><strong>Example of svg generated</strong></p>
  
  <pre><code>CODE128 = barcode.get_barcode_class('code128')
  package_no_barcode = CODE128(u'PLAI73664PJHS')
  package_no_barcode.save('PSKK')
  </code></pre>
  
  <p>generate svg - </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;svg xmlns="http://www.w3.org/2000/svg" height="23.000mm" version="1.1" width="40.000mm"&gt;
      &lt;!--Autogenerated with python-barcode 0.9.0--&gt;
      &lt;g id="barcode_group"&gt;
          &lt;rect height="100%" style="fill:white" width="100%"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="2.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="2.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="3.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="3.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="3.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.800mm" x="3.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="4.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="5.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="5.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="6.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="6.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="6.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="6.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="7.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="7.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="8.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="8.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="8.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="9.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="9.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="9.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="9.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="10.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="10.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="11.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="11.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="12.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="12.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="13.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="13.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="13.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="13.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="13.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="14.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.800mm" x="14.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="15.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="15.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.800mm" x="15.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="16.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="17.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="17.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="17.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="17.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="18.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="18.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.800mm" x="18.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="19.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="19.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="20.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="20.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.800mm" x="20.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="21.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="21.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="22.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="22.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="22.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="23.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="23.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="23.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="24.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="24.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="25.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="25.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="25.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="26.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="26.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="26.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="26.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="27.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="27.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="27.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="28.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="28.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="29.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="29.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="30.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="30.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="30.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="31.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="31.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="31.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="32.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="32.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="32.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="33.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="33.740mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="34.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="34.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="34.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="35.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="35.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="35.940mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="36.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="37.140mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="37.340mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="37.540mm" y="1.000mm"/&gt;
          &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="37.740mm" y="1.000mm"/&gt;
          &lt;text style="fill:black;font-size:10pt;text-anchor:middle;" x="20.340mm" y="21.000mm"&gt;PLAI73664PJHS&lt;/text&gt;
      &lt;/g&gt;
  &lt;/svg&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Update</strong> - using <code>.render</code>, - <code>'package_no_barcode':package_no_barcode.render</code>, i can get the svg code but not for html - </p>
  
  <pre><code>b'&lt;?xml version="1.0" encoding="UTF-8"?&gt;\r\n&lt;!DOCTYPE svg\r\n PUBLIC \'-//W3C//DTD SVG 1.1//EN\'\r\n
  \'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\'&gt;\r\n&lt;svg height="23.000mm" version="1.1" width="38.000mm" xmlns="http://www.w3.org/2000/svg"&gt;\r\n
  &lt;!--Autogenerated with python-barcode 0.9.0--&gt;\r\n &lt;g id="barcode_group"&gt;\r\n &lt;rect height="100%" style="fill:white" width="100%"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="2.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="2.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="3.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.400mm" x="3.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="3.740mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.800mm" x="3.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.400mm" x="4.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="5.140mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.600mm" x="5.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="5.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="6.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.200mm" x="6.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="6.940mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="7.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.200mm" x="8.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="8.340mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="8.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="8.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="9.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.600mm" x="9.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="10.340mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="10.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.400mm" x="10.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="11.140mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.600mm" x="11.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="11.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="12.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.600mm" x="12.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="12.940mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="13.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.200mm" x="13.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="13.740mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="14.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="14.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="14.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.200mm" x="15.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="15.740mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="16.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.200mm" x="16.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="16.940mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="17.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.400mm"
  x="17.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="17.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.400mm" x="18.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="18.740mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="18.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.600mm" x="19.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="19.940mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="20.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm"
  x="20.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="21.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.200mm" x="21.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="21.540mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="21.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.600mm" x="22.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="22.940mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.200mm" x="23.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="23.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="23.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.200mm" x="24.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="24.540mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="24.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.600mm" x="25.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="25.940mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.400mm" x="26.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="26.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="26.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.400mm" x="26.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.600mm" x="27.340mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="27.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.400mm" x="28.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="28.540mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.600mm" x="28.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="29.540mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="29.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.400mm" x="29.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="30.340mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.400mm" x="30.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.400mm" x="31.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="31.540mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.200mm" x="32.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm"
  x="32.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.200mm" x="32.940mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm"
  style="fill:white;" width="0.200mm" x="33.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="33.340mm"
  y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.600mm" x="33.740mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;"
  width="0.600mm" x="34.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm" x="34.940mm" y="1.000mm"/&gt;\r\n &lt;rect
  height="15.000mm" style="fill:black;" width="0.200mm" x="35.140mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:white;" width="0.200mm"
  x="35.340mm" y="1.000mm"/&gt;\r\n &lt;rect height="15.000mm" style="fill:black;" width="0.400mm" x="35.540mm" y="1.000mm"/&gt;\r\n &lt;text
  style="fill:black;font-size:10pt;text-anchor:middle;" x="19.240mm" y="21.000mm"&gt;UXXWL94HXO08&lt;/text&gt;\r\n &lt;/g&gt;\r\n&lt;/svg&gt;\r\n'
  </code></pre>
  
  <p>How to make svg image with this code ?</p>