title: Generate data label with barcode(html or jpg or pdf) and print it (now barcode does not generate)
body: <p>Trying to solve a problem linked to bar-codes in html.  What i need to do is to create a template of label with bar-code in it and send to printer. I choosed to use html language to create that template with input data. I could get that html and it looks like this in picture.
  <a href="https://i.stack.imgur.com/QEUCA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QEUCA.png" alt="enter image description here"></a>
  Howerer, then i tried to print that html i got that label but without bar-code printed.  So i tried to convert it to pdf and send to printer, but whenever i tried to convert to pdf, i get in converted pdf that label without bar-codes. 
  Tried to use some different libraries (<code>pdfkit,pdfcrowd,PyQt4.QtGui</code>), none saved pdf with barcode. Attaching script:</p>
  
  <pre><code>for index, row in output_ramco.iterrows():
  
      print row['PARTNOMLT_OUT']
      htmlas = '''
  
              &lt;html&gt;&lt;head&gt;
              &lt;meta name="author" content="VS"&gt;
              &lt;meta name="description" content="include bar code type code39 in html files with javascript"&gt;
              &lt;meta name="keywords" content="code39, javascript"&gt;
              &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
              &lt;script language="JavaScript" src="code39.js"&gt;&lt;/script&gt;
              &lt;/head&gt;
                  &lt;body style="font-family:Verdana; font-size:11pt"&gt;
  
                  &lt;style type="text/css" media = "print"&gt;
                          @page 
                  {
                      size: auto;   /* auto is the current printer page size */
                      margin: 3mm;  /* this affects the margin in the printer settings */
                  }
                  .tg  {border-collapse:collapse;border-spacing:0;}
                  .tg td{font-family:Arial, sans-serif;font-size:8px;padding:5px 4px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
                  .tg th{font-family:Arial, sans-serif;font-size:8px;font-weight:normal;padding:5px 4px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
                  .tg .tg-9hbo{font-weight:bold;vertical-align:top}
                  .tg .tg-yw4l{vertical-align:top}
  
                  &lt;/style&gt; 
  
                  &lt;script language="JavaScript"&gt;
                  document.open();
                  Code39("12","175",20,1800,"'''+str(row['PARTNOMLT_OUT'])+'''");
                  Code39("12","197",20,1800,"'''+str(row['LOTSN'])+'''");
                  document.close();
                  &lt;/script&gt; 
  
  
  
                  &lt;table class="tg" cellspacing="0" cellpadding="0"&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;PN:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="2"&gt;'''+str(row['PARTNOMLT_OUT'])+'''&lt;/td&gt;
                      &lt;td class="tg-9hbo"&gt;QTY:&lt;/td&gt;
                      &lt;td class="tg-yw4l"&gt;'''+str(row['KIEKIS'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-yw4l" colspan="5"&gt;'''+str(row['PARTDESCMLT_OUT'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;LOT/SN#:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+str(row['LOTSN'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Stock Status:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+row['STATUSMLT_OUT']+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Shelf Life Expiry Dt.:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+row['EXP_DATE']+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Certificate Type/No:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+str(row['CERTAI'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Source Document #&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+str(row['SOURCE_DOC'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Storage Area:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+str(row['STORAGE'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-9hbo"&gt;Owner # :&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="4"&gt;'''+row['OWNERIS']+'''&lt;/td&gt;
                    &lt;/tr&gt;
  
                    &lt;tr&gt;
                      &lt;td class="tg-yw4l" colspan="5"&gt;11&lt;/td&gt;
                    &lt;/tr&gt;
  
                    &lt;tr&gt;
                      &lt;td class="tg-yw4l" colspan="5"&gt;11&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td class="tg-yw4l"&gt;EIA Issue 2&lt;/td&gt;
                      &lt;td class="tg-9hbo"&gt;Generated On:&lt;/td&gt;
                      &lt;td class="tg-yw4l" colspan="3"&gt;'''+str(row['GENERATED'])+'''&lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/table&gt;                
                  &lt;/body&gt;
              &lt;/html&gt;
  
      '''
  
  try:
      with open(dir_files+'html_test.html', 'w') as file:
          file.write(htmlas.encode('UTF-8'))
  except Exception, e:
      log_error()
  
  
  ######1st
  #from PyQt4.QtGui import QTextDocument, QPrinter, QApplication
  #import sys
  #app = QApplication(sys.argv)
  #doc = QTextDocument()
  #location = "html_test.html"
  #html = open(location).read()
  #doc.setHtml(html)
  #printer = QPrinter()
  #printer.setOutputFileName("foo.pdf")
  #printer.setOutputFormat(QPrinter.PdfFormat)
  #printer.setPageSize(QPrinter.A4);
  #printer.setPageMargins (15,15,15,15,QPrinter.Millimeter);
  #doc.print_(printer)
  
  
  ######2nd
  #import pdfcrowd
  #client = pdfcrowd.Client("orangutangas", "pwd")
  #output_file = open('htmlas.pdf', 'wb')
  #client.convertHtml(htmlas, output_file)
  #output_file.close()
  
  
  #########3rd
  #path_wkthmltopdf = r'C:\Program Files (x86)\wkhtmltopdf\bin\wkhtmltopdf.exe'
  #config = pdfkit.configuration(wkhtmltopdf=path_wkthmltopdf)
  #pdfkit.from_string(htmlas, 'out.pdf',configuration=config)
  </code></pre>
  
  <p>So how can i translate html or make a jpg/pdf where printer can read this info and print properly with barcode thjat label?</p>