How to generate pdf on website

I trying to generate a pdf file of a html in erpnext website. So i am planning to do this with jquery is there any frappe’s function to generate pdf file in website(not in website)

if there is please help me to do this

pdf file in website(not in website)

Confusing! Can you please share the usecase?

Solution could be add PDF as a public file in your ERPNext account, or on service like Dropbox. In the Item Description, add link of that file.

i trying to generate a pdf of html.The html file is one of the page in website of erpnext. Now i am using jquery.

I want to know is there any frappe functions to do that.

i hope now question is clear

Hi @shahid_khan021

Frappe doesn’t have specific method at js side to convert html to pdf, this functionality can be achieve from the py side. You can refer below files to generate the pdf file

You need to write the whitelist method in your custom app and call the above method, for example

Call the above whitelist method from js side, refer below code

3 Likes

@rohit_w i will infrom you after i try

@rohit_w

xhr.open(“POST”, ‘/api/method/frappe.utils.print_format.report_to_pdf’);

should i change above to like this

xhr.open(“POST”, ‘/erpnext/school/fdoctype/program/program.py’);

bad documentation you have to explain much better