#NEWLINE# @ frappe . whitelist ( ) #NEWLINE# def download_pdf( doctype , name , format = None ) : #NEWLINE# #INDENT# html = frappe . get_print ( doctype , name , format ) #NEWLINE# frappe . local . response . filename = '{name}.pdf' . format ( name = name . replace ( ' ' , '-' ) . replace ( '/' , '-' ) ) #NEWLINE# frappe . local . response . filecontent = get_pdf ( format ) #NEWLINE# frappe . local . response . type = 'download'