diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.py b/lms/lms/doctype/lms_certificate/lms_certificate.py index 93487cad..2467fff9 100644 --- a/lms/lms/doctype/lms_certificate/lms_certificate.py +++ b/lms/lms/doctype/lms_certificate/lms_certificate.py @@ -42,3 +42,9 @@ def create_certificate(course): }) certificate.save(ignore_permissions=True) return certificate + +@frappe.whitelist() +def get_certificate_pdf(html): + frappe.local.response.filename = "certificate.pdf" + frappe.local.response.filecontent = get_pdf(html, {"orientation": "LandScape"}) + frappe.local.response.type = "pdf" diff --git a/lms/public/css/style.css b/lms/public/css/style.css index 25691d06..476d63f4 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -829,7 +829,7 @@ pre { .certificate-content { background-color: #FFFFFF; - border-width: 100px; + border-width: 10px; border-style: solid; } diff --git a/lms/templates/certificate.html b/lms/templates/certificate.html index 8064b42c..e798cc1d 100644 --- a/lms/templates/certificate.html +++ b/lms/templates/certificate.html @@ -1,30 +1,35 @@ -