Printformat issue ,

when i am trying to print my format i getting this error

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
    html = self.get_html()
  File "apps/frappe/frappe/website/utils.py", line 517, in cache_html_decorator
    html = func(*args, **kwargs)
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 162, in update_context
    data = self.run_pymodule_method("get_context")
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 224, in run_pymodule_method
    return method(self.context)
  File "apps/frappe/frappe/www/printview.py", line 68, in get_context
    "title": frappe.utils.strip_html(doc.get_title() or doc.name),
  File "apps/frappe/frappe/utils/data.py", line 1478, in strip_html
    return _striptags_re.sub("", text)
TypeError: expected string or bytes-like object

@Jignesh_01

If it’s custom print format, please share code here

dont know code is in raw or htmll form

Tax Invoice

National Enterprises Invoice No Dated
consignee Delivery Note Mode/Terms of payment
Buyer (Bill to) Refrence No & Date Other Referance
Buyer's Doc No. Dated
Dispatch Doc No. Delivery Note Date
Dispatch Through Destination
Terms of Delivery
Sr.No Description of Goods Quantity Rate Per Amount
1 Almond Cookies 20 pcs 30.0 pcs 600.00
Total 20 pcs $ 600
Amount Chargeable (in words)
INR SIX HUNDRED ONLY
E & OE
Declaration
We declare that this invoice shows the actual price of the goods described and that all particulars are true and correct.
for National Enterprises

CSS

#table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
#tr2{
width: 100%;
}

#tdb{
font-size: small;
height: 200px;
width:40%;

}

#th1 {
font-size:small;
color: black;
width:3%;
}
#th2{
font-size:small;
color:black;
width:60%;
}
#th3{
font-size:small;
color: black;
width:1%;
}
#th5{
font-size:small;
color: black;
width:15%;
}
#th4{
font-size:small;
color: black;
width:10%;
}
#th6{
font-size:small;
color: black;
width:15%;
}

#td1{
font-size:small;

}
#td2{
font-size:small;
}

#to{
text-align: right;
font-size:small;
color: black;
}

.width{
width:30%;
}

#col{
text-align: right;
font-size:60%;

 border-left-style: none;

}
#coll{
text-align: right;
font-size:60%;

}
.col{

text-align: left;
font-size:60%;
border-right-style: none;
border-bottom-style: none; 

}

#colm{
text-align: left;
font-size:60%;
border-top-style:none ;
}

This issue arises after I changed the naming configuration of the Doctype:

  1. Initially: The Doctype was set to use Autoincrement for naming.
  2. Changed to: I modified the Doctype to use Expression-based naming.
  3. Reverted to Autoincrement: I reverted back to Autoincrement for testing.
    After this print was not worked.

The issue seems to be linked to the changes made to the Doctype’s naming system. When the Doctype was set back again to Expression. It worked.