Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,17 +34,7 @@ def add_certificate_entry(username, name):
|
|
34 |
|
35 |
# Function to generate certificate PDF
|
36 |
def generate_certificate(name, score):
|
37 |
-
|
38 |
-
pdf.add_page()
|
39 |
-
pdf.set_font("Arial", size=24)
|
40 |
-
pdf.cell(200, 20, txt="Certificate of Excellence", ln=True, align="C")
|
41 |
-
pdf.set_font("Arial", size=16)
|
42 |
-
pdf.cell(200, 10, txt=f"Presented to {name}", ln=True, align="C")
|
43 |
-
pdf.cell(200, 10, txt=f"For passing Unit 4 with a score of {score}", ln=True, align="C")
|
44 |
-
pdf.cell(200, 10, txt=f"Date: {datetime.now().strftime('%Y-%m-%d')}", ln=True, align="C")
|
45 |
-
pdf_output = io.BytesIO()
|
46 |
-
pdf.output(pdf_output)
|
47 |
-
pdf_output.seek(0)
|
48 |
return pdf_output
|
49 |
|
50 |
# Main function to handle certificate generation
|
|
|
34 |
|
35 |
# Function to generate certificate PDF
|
36 |
def generate_certificate(name, score):
|
37 |
+
pdf_output = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
return pdf_output
|
39 |
|
40 |
# Main function to handle certificate generation
|