Barcode appears in Print Preview ,But not showing while taking printout

In Erpnext i had used the field type Barcode in my Custom Doctype Lot Number.While Submitting the Lot Number Document a barcode is generated using the name of the lot number. I had added that in my print format Created for Lot Number.While taking print the barcode field comes properly in print preview,But when i try taking print barcode gets disappeared only barcode number is shown .

Below is the Print Preview image of my custom doctype Lot Number Where the barcode is shown Properly
Screenshot from 2023-07-31 20-26-45

Below image shows how the print of lot number appears while taking Print.In the above picture we could see that the barcode was coming as it should be,here only the barcode Number is visible.
Screenshot from 2023-07-31 20-27-33

This is how i had called the barcode field (scan_lot) field in jinja tags.
Screenshot from 2023-07-31 19-46-53

I need the barcode field to be visible while taking printout as well.Can anyone help with the issue ?
Below is the code of print format

{% if doc.docstatus ==0 %}
<h1><b>Attention</b></h1>
<h2>{{doc.name}}</h2>
<p>This Document you are trying to make print out is not submitted. Please change document from DRAFT status using Submit Button.This will create the Consignment Submitted and allow Printout of the same.
<br>Thankyou!
</p>
{% else %}
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
    {% if letter_head and not no_letterhead %}
    <div class="letter-head">{{ letter_head }}</div>
    {% endif %}
    
    {% if max_pages > 1 %}
    <p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
    {% endif %}
{%- endmacro -%}
{{ add_header(0,1,doc,letter_head, no_letterhead) }}
 <table cellpadding=0 cellspacing=0 class="table0 border" colspan="10"><tr class="bord">
 <tr>
   <td style="font-size:60px;color:grey" colspan="10">LOT ITINERARY</td>    
   </tr>
   {% if doc.pickup_station %}
   {% set war=frappe.get_doc("Warehouse",doc.pickup_station) %}
   {% if doc.dropoff_station %}
                {% set war1=frappe.get_doc("Warehouse",doc.end_station) %}
    <tr>
                <td style="font-size:40px;color:grey" colspan="10"><b>{% if war.station_code1 %}{{war.station_code1}}{% endif %}-{% if war1.station_code1 %}{{war1.station_code1}}{% endif %}</b></td>
                
                </tr>
                {% endif %}
                {% endif %}
    <tr>
         <td  style="float: left; font-size: 20px;" colspan="10"><b>Station in Charge:</b>
         {% set user=frappe.get_doc("User",doc.owner)%}
         {% if user.full_name%}&nbsp;{{user.full_name}}{% endif %}<br>
         <b>Mobile No:</b>&nbsp;{% if user.phone%}{{user.phone}}{% endif %}
         </td>            
    </tr>
    </table>
    
    <p class="barcode" style="width:300px;">{{doc.scan_lot}}</p>

    <hr width="100%" style="border:solid 1px;">
                  


                 <table  class="table table-bordered bord1" style="font-size:16px;font-family:Cursive;" width="100%">
                     <tr style="background-color:lightgrey">
                         <th width="5%"><b>Sr</b></th>
                         <th width="20%"><b>Customer</b></th>
                         <th width="15%"><b>Customer No</b></th>
                         <th width="25%"><b>Consignment No</b></th>
                         <th width="20%"><b>Receiver No</b></th>
                         <th width="15%"><b>Phone</b></th>
                     </tr>
                      {% for i in doc.destination_table %}
                     
                    <tr >
                         <td width="5%">{{loop.index}}</td>
                         <td width="20%">{{i.customer}}</td>
                         <td width="15%">{{i.sender_phone}}</td>
                         <td width="25%">{{i.consignment_number}}</td>
                         <td width="20%">{{i.receiver_name}}</td>
                         <td width="15%">{{i.receiver_phone}}</td>
                    </tr>
                   {% endfor %}
                   
                 </table>
                 <br><br>
                   
   
                 
<div class="footer">
     {%- macro add_header(page_num, max_pages, doc, footer, no_letterhead) -%}
    {% if footer and not no_letterhead %}
    <div class="letter-head">{{ footer }}</div>
    {% endif %}
    
    {%- endmacro -%}
    {{ add_header(0,1,doc,footer, no_letterhead) }}
</div>
<div class="page-break"></div>
{% endif %}
1 Like

Have you find the resolution for this?