Download the Web form page in pdf

how do all students in the education module download the form in pdf
i used this http://site.local:8000/api/method/frappe.utils.print_format.download_pdf?doctype={doctype}&name={name}&format={print_format_name}&no_letterhead=0
but the formula above is manual
someone to help me with the custom code for the webform to achieve the pdf download

when i use the codes bellow in the doctype form it works but it doesnot work on the web forms
frappe.ui.form.on(“Student Applicant”, “refresh”, function(frm){
frm.add_custom_button(“PDF”, function(){
var myWin = window.open(‘http://localhost:8080/api/method/frappe.utils.print_format.download_pdf?doctype=Student Applicant&name=’+cur_frm.doc.name+‘&format=invoice%20print%20format&no_letterhead=0&letterhead=oais&settings=%7B%7D&_lang=en’);
});
});
I would like to create a button on the web form to download that form in pdf form… please help

Please provide more details about what you’re trying to do. How are we supposed to understand your problem from half a sentence? :wink:

how do all students in the education module download the form in pdf
i used this http://site.local:8000/api/method/frappe.utils.print_format.download_pdf?doctype={doctype}&name={name}&format={print_format_name}&no_letterhead=0
but the formula above is manual
someone to help me with the custom code for the webform to achieve the pdf download

when i use the codes bellow in the doctype form it works but it doesnot work on the web forms
frappe.ui.form.on(“Student Applicant”, “refresh”, function(frm){
frm.add_custom_button(“PDF”, function(){
var myWin = window.open(‘http://localhost:8080/api/method/frappe.utils.print_format.download_pdf?doctype=Student Applicant&name=’+cur_frm.doc.name+’&format=invoice%20print%20format&no_letterhead=0&letterhead=oais&settings=%7B%7D&_lang=en’);
});
});
I would like to create a button on the web form to download that form in pdf form… please help