Appear Comment in Print Format

How to Appear Comment in Print Format

Comment Is Doctype In Erpnext,
if You Write any Comment ,New Record Is Created in comment Doctype With
Link Of Reference Document Type,Reference Name
You Can use
frappe.db.get_value(“Comment”,{“reference_document_name”:doc.name,"reference_document_type:doc.doctype},[“content”])

Note:Please Check technical name of fields