@frappe.whitelist()
def get_html_and_style(doc, name=None, print_format=None, meta=None, no_letterhead=None, trigger_print=False):
 if (isinstance(doc, basestring) and isinstance(name, basestring)):
  doc = frappe.get_doc(doc, name)
 if isinstance(doc, basestring):
  doc = frappe.get_doc(json.loads(doc))
 print_format = get_print_format_doc(print_format, meta=(meta or frappe.get_meta(doc.doctype)))
 return {u'html': get_html(doc, name=name, print_format=print_format, meta=meta, no_letterhead=no_letterhead, trigger_print=trigger_print), u'style': get_print_style(print_format=print_format)}

@ frappe . whitelist ( ) def get_html_and_style ( doc , name = None , print_format = None , meta = None , no_letterhead = None , trigger_print = False ) : if ( isinstance ( doc , basestring ) and isinstance ( name , basestring ) ) : doc = frappe . get_doc ( doc , name ) if isinstance ( doc , basestring ) : doc = frappe . get_doc ( json . loads ( doc ) ) print_format = get_print_format_doc ( print_format , meta = ( meta or frappe . get_meta ( doc . doctype ) ) ) return { u'html' : get_html ( doc , name = name , print_format = print_format , meta = meta , no_letterhead = no_letterhead , trigger_print = trigger_print ) , u'style' : get_print_style ( print_format = print_format ) }
returns html and style of print format .