barcode : zebra : print - ashish-greycube/help GitHub Wiki

barcode_zebra

<body onload='JsBarcode("#barcode").init()'>
  <style>
    .item-text {
      width: 42mm !important;
      height: 10mm!important;
      border: 0px solid black;
      padding: 0px;
      margin: 0px;
      table-layout:fixed;
      
      /*font-size: 8px;*/
      /*font-weight: bold;*/
      
    }

    .no-print {
      margin: 0px 0px;
    }
    @media print {
      .no-print {
        display: none;
      }
    }
  </style>
{% set prices = frappe.get_all('Item Price', filters={'item_code': doc.item_code,'selling':1}, fields=['price_list_rate'], order_by='modified desc') %}
{% set sales_price =prices[0].price_list_rate  or 0%}
  <table class="item-text">
    <tr>
      <td style="width: 21mm!important padding-right: 0; padding-top: 0; padding-left: 0;padding-bottom: 0;margin: 0;">          
        <svg
          id="barcode"
          jsbarcode-value={{doc.barcodes[0].barcode}}
          jsbarcode-margin="0"
          jsbarcode-displayValue="false"
          jsbarcode-height="38"
          jsbarcode-width="1">
        </svg></td>
        <td style=" word-wrap:break-word;width: 21mm!important padding-right: 0; padding-top: 0; padding-left: 0;padding-bottom: 0;margin: 0;font-size: 9px;text-align: right;">{{doc.item_name}} || {{doc.item_code}} || {{sales_price}} SAR</td>
    </tr>
  </table>
  <script src="assets/frappe/node_modules/jsbarcode/dist/JsBarcode.all.min.js"></script>
</body>

this print preview page is out of our control..using iframe or something and just loading static html.. won't run any script html generated by jinja..but wont execute js

⚠️ **GitHub.com Fallback** ⚠️