Spaces:
Running
Running
from reportlab.pdfgen import canvas | |
import tempfile | |
def generate_summary_pdf(candidates): | |
"""Generate a PDF report for shortlisted candidates.""" | |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") | |
c = canvas.Canvas(temp_file.name) | |
c.drawString(100, 800, "Shortlisted Candidates") | |
y = 780 | |
for candidate in candidates: | |
y -= 20 | |
c.drawString(100, y, f"{candidate.name} - Score: {candidate.score}") | |
c.save() | |
return temp_file.name # Return path to the PDF |