Certification Generator Skill
This skill allows you to generate a premium "JABALF15AI" completion certificate in PDF format. It uses Python's reportlab library to draw vector graphics, custom fonts, and a premium "Black & Gold" design.
Prerequisites
The user must have reportlab installed:
bash
pip install reportlab
Instructions
When the user requests a certificate, generate a Python script with the following logic:
- •
Inputs:
- •Student Name
- •Course/Skill Title (e.g., "Golden Dashboard Master")
- •Date
- •Score (Optional)
- •
Design Specs (Golden Theme):
- •Background: Black (
#000000) or Dark Charcoal (#1A1A1A). - •Border: Double Gold border (
#FFD700). - •Fonts: Serif for the title (e.g., Times-Roman or custom if available), Sans-serif for details.
- •Logo/Icon: A placeholder Gold circle or text "JABALF15AI".
- •Background: Black (
- •
Python Implementation Pattern: Use
reportlab.pdfgen.canvasfor drawing.
Example Output Script
If the user asks: "Create a certificate for Ali for completing Power BI Analysis."
Response Code:
python
from reportlab.lib.pagesizes import landscape, A4
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
def create_certificate(student_name, course_title, date_str, score=None, filename="certificate.pdf"):
# Setup Canvas (Landscape A4)
c = canvas.Canvas(filename, pagesize=landscape(A4))
width, height = landscape(A4)
# --- 1. Background ---
c.setFillColor(HexColor("#1A1A1A"))
c.rect(0, 0, width, height, fill=1)
# --- 2. Golden Border ---
c.setStrokeColor(HexColor("#FFD700"))
c.setLineWidth(5)
c.rect(30, 30, width-60, height-60)
c.setLineWidth(1)
c.rect(40, 40, width-80, height-80) # Inner border
# --- 3. Header ---
c.setFillColor(HexColor("#FFD700"))
c.setFont("Helvetica-Bold", 40)
c.drawCentredString(width/2, height - 120, "CERTIFICATE")
c.setFont("Helvetica", 20)
c.setFillColor(HexColor("#FFFFFF"))
c.drawCentredString(width/2, height - 160, "OF COMPLETION")
# --- 4. Student Name ---
c.setFillColor(HexColor("#FFD700"))
c.setFont("Times-BoldItalic", 50) # Premium look
c.drawCentredString(width/2, height/2 + 20, student_name)
# --- 5. Course Details ---
c.setFillColor(HexColor("#FFFFFF"))
c.setFont("Helvetica", 18)
c.drawCentredString(width/2, height/2 - 40, "Has successfully master the skill of:")
c.setFont("Helvetica-Bold", 24)
c.setFillColor(HexColor("#FFD700"))
c.drawCentredString(width/2, height/2 - 80, course_title)
# --- 6. Footer (Date & Score) ---
c.setFont("Helvetica", 14)
c.setFillColor(HexColor("#AAAAAA"))
c.drawString(100, 100, f"Date: {date_str}")
if score:
c.drawRightString(width-100, 100, f"Score: {score}%")
c.drawCentredString(width/2, 60, "JABALF15AI ACADEMY")
c.save()
print(f"Certificate saved as {filename}")
# Usage
if __name__ == "__main__":
create_certificate("Ali Ahmed", "Power BI Data Analysis", "2024-05-20", "95")