Return pdf as response

Hi,

I have written code to generate pdf but unable to send pdf to browser in web services.

Please let me know how can i achieve…
Let me know any other information needed…

Check this, hope it helps.

JS called

Python response

1 Like

Is exists some function which can return pdf as response? For example:

response= get_pdf(doctype_name=“name”)
with open(“file.pdf”,“wb”) as file:
file.write(response)

Function download pdf returns nothing

Does this help?
http://site.local:8000/api/method/frappe.utils.print_format.download_pdf?doctype={doctype}&name={name}&format={print_format_name}&no_letterhead=0

1 Like