Make a template for poster presentation at R.N.T medical college udaipur on 21/06/26,22/06/26 for pg residents pan india

Asking for Preferences
Asking for Preferences
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/rnt-invite

Writing File

~/rnt-invite/create_invite.py

from reportlab.lib.pagesizes import A2
from reportlab.lib import colors
from reportlab.lib.units import inch, cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor, white, black
import os

# Output path
output_path = "/home/daytona/workspace/rnt-invite/RNT_PGConference_Invite_2026.pdf"

# Page setup - A2 portrait (good for a conference invite poster)
PAGE_WIDTH, PAGE_HEIGHT = 16.54 * inch, 23.39 * inch  # A2

# ---- COLOR PALETTE ----
DARK_BLUE    = HexColor("#0B2C6E")   # deep navy
GOLD         = HexColor("#C9A227")   # gold accent
LIGHT_BLUE   = HexColor("#1E5FAD")   # mid blue
PALE_BLUE    = HexColor("#DDE9F7")   # very light blue bg
WARM_WHITE   = HexColor("#FAFAF5")
MED_GRAY     = HexColor("#555555")
LIGHT_GOLD   = HexColor("#F5E6B3")

class InviteCanvas(canvas.Canvas):
    """Custom canvas that draws background and decorative elements on each page."""

    def __init__(self, filename, pagesize):
        super().__init__(filename, pagesize=pagesize)
        self.pagesize = pagesize

    def save(self):
        self._draw_background()
        super().save()

    def showPage(self):
        self._draw_background()
        super().showPage()

    def _draw_background(self):
        w, h = self.pagesize

        # Full page background gradient simulation (light top, white middle)
        self.setFillColor(PALE_BLUE)
        self.rect(0, 0, w, h, fill=1, stroke=0)

        # Top header band
        self.setFillColor(DARK_BLUE)
        self.rect(0, h - 3.5*inch, w, 3.5*inch, fill=1, stroke=0)

        # Gold top stripe
        self.setFillColor(GOLD)
        self.rect(0, h - 0.18*inch, w, 0.18*inch, fill=1, stroke=0)

        # Gold bottom stripe of header
        self.setFillColor(GOLD)
        self.rect(0, h - 3.5*inch, w, 0.1*inch, fill=1, stroke=0)

        # Bottom footer band
        self.setFillColor(DARK_BLUE)
        self.rect(0, 0, w, 2.2*inch, fill=1, stroke=0)

        # Gold top stripe of footer
        self.setFillColor(GOLD)
        self.rect(0, 2.2*inch, w, 0.1*inch, fill=1, stroke=0)

        # Gold bottom stripe
        self.setFillColor(GOLD)
        self.rect(0, 0, w, 0.18*inch, fill=1, stroke=0)

        # Left decorative sidebar strip
        self.setFillColor(LIGHT_BLUE)
        self.setStrokeColor(LIGHT_BLUE)
        self.rect(0, 2.3*inch, 0.45*inch, h - 5.8*inch, fill=1, stroke=0)

        # Right decorative sidebar strip
        self.rect(w - 0.45*inch, 2.3*inch, 0.45*inch, h - 5.8*inch, fill=1, stroke=0)

        # Decorative circle top-right in header
        self.setFillColor(LIGHT_BLUE)
        self.circle(w - 1.2*inch, h - 1.2*inch, 1.1*inch, fill=1, stroke=0)
        self.setFillColor(GOLD)
        self.circle(w - 1.2*inch, h - 1.2*inch, 0.75*inch, fill=1, stroke=0)
        self.setFillColor(DARK_BLUE)
        self.circle(w - 1.2*inch, h - 1.2*inch, 0.45*inch, fill=1, stroke=0)

        # Decorative circle top-left in header
        self.setFillColor(LIGHT_BLUE)
        self.circle(1.2*inch, h - 1.2*inch, 1.1*inch, fill=1, stroke=0)
        self.setFillColor(GOLD)
        self.circle(1.2*inch, h - 1.2*inch, 0.75*inch, fill=1, stroke=0)
        self.setFillColor(DARK_BLUE)
        self.circle(1.2*inch, h - 1.2*inch, 0.45*inch, fill=1, stroke=0)


def build_invite():
    doc = SimpleDocTemplate(
        output_path,
        pagesize=(PAGE_WIDTH, PAGE_HEIGHT),
        rightMargin=1.1*inch,
        leftMargin=1.1*inch,
        topMargin=4.0*inch,
        bottomMargin=2.6*inch,
        title="RNT PG Conference Invite 2026",
        author="R.N.T. Medical College, Udaipur"
    )

    story = []

    # ---- STYLES ----
    styles = getSampleStyleSheet()

    def S(name, **kwargs):
        return ParagraphStyle(name, **kwargs)

    college_style = S("College",
        fontName="Helvetica-Bold", fontSize=26, leading=30,
        textColor=white, alignment=TA_CENTER, spaceAfter=4)

    sub_college_style = S("SubCollege",
        fontName="Helvetica", fontSize=14, leading=18,
        textColor=LIGHT_GOLD, alignment=TA_CENTER, spaceAfter=6)

    conf_name_style = S("ConfName",
        fontName="Helvetica-Bold", fontSize=46, leading=52,
        textColor=GOLD, alignment=TA_CENTER, spaceBefore=18, spaceAfter=6)

    conf_tagline_style = S("Tagline",
        fontName="Helvetica-BoldOblique", fontSize=20, leading=26,
        textColor=DARK_BLUE, alignment=TA_CENTER, spaceAfter=18)

    section_head_style = S("SecHead",
        fontName="Helvetica-Bold", fontSize=22, leading=26,
        textColor=DARK_BLUE, alignment=TA_CENTER, spaceBefore=20, spaceAfter=8)

    body_style = S("Body",
        fontName="Helvetica", fontSize=16, leading=22,
        textColor=MED_GRAY, alignment=TA_CENTER, spaceAfter=6)

    highlight_style = S("Highlight",
        fontName="Helvetica-Bold", fontSize=18, leading=24,
        textColor=DARK_BLUE, alignment=TA_CENTER, spaceAfter=4)

    date_style = S("Date",
        fontName="Helvetica-Bold", fontSize=30, leading=36,
        textColor=DARK_BLUE, alignment=TA_CENTER, spaceBefore=10, spaceAfter=4)

    venue_style = S("Venue",
        fontName="Helvetica", fontSize=18, leading=24,
        textColor=MED_GRAY, alignment=TA_CENTER, spaceAfter=6)

    white_style = S("White",
        fontName="Helvetica", fontSize=15, leading=20,
        textColor=WARM_WHITE, alignment=TA_CENTER, spaceAfter=4)

    gold_footer_style = S("GoldFooter",
        fontName="Helvetica-Bold", fontSize=16, leading=20,
        textColor=GOLD, alignment=TA_CENTER, spaceAfter=4)

    white_bold_style = S("WhiteBold",
        fontName="Helvetica-Bold", fontSize=17, leading=22,
        textColor=white, alignment=TA_CENTER, spaceAfter=4)

    small_white = S("SmallWhite",
        fontName="Helvetica", fontSize=13, leading=17,
        textColor=WARM_WHITE, alignment=TA_CENTER, spaceAfter=2)

    # ---- HEADER CONTENT (inside the blue band) ----
    # These appear at top but because topMargin=4inch, we need spacers to push up
    # We use negative spacer to offset into header area
    story.append(Spacer(1, -2.8*inch))

    story.append(Paragraph("R.N.T. MEDICAL COLLEGE & M.B. HOSPITALS", college_style))
    story.append(Paragraph("Maharana Pratap University of Health Sciences, Udaipur", sub_college_style))
    story.append(Paragraph("Department of General Medicine", sub_college_style))

    story.append(Spacer(1, 0.1*inch))

    # ---- CONFERENCE TITLE ----
    story.append(Paragraph("MEDINOVA 2026", conf_name_style))
    story.append(Paragraph(
        "National PG Residents\u2019 Research Conference",
        conf_tagline_style))

    story.append(HRFlowable(width="85%", thickness=2, color=GOLD, spaceAfter=14))

    # ---- DATE & VENUE BOX ----
    date_table_data = [
        [Paragraph("21 & 22 June 2026", date_style)],
        [Paragraph("Sunday & Monday", body_style)],
        [Spacer(1, 0.05*inch)],
        [Paragraph(
            "Venue: Conference Hall, R.N.T. Medical College, Udaipur, Rajasthan",
            venue_style)],
    ]
    date_table = Table(date_table_data, colWidths=[13*inch])
    date_table.setStyle(TableStyle([
        ("BOX", (0,0), (-1,-1), 1.5, LIGHT_BLUE),
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_GOLD),
        ("ROUNDEDCORNERS", [12]),
        ("TOPPADDING", (0,0), (-1,-1), 12),
        ("BOTTOMPADDING", (0,0), (-1,-1), 12),
        ("LEFTPADDING", (0,0), (-1,-1), 18),
        ("RIGHTPADDING", (0,0), (-1,-1), 18),
    ]))
    story.append(date_table)
    story.append(Spacer(1, 0.3*inch))

    # ---- WHO SHOULD ATTEND ----
    story.append(Paragraph("WHO SHOULD ATTEND", section_head_style))
    story.append(HRFlowable(width="60%", thickness=1.5, color=GOLD, spaceAfter=10))
    story.append(Paragraph(
        "PG Residents (MD / MS / DNB) from all medical colleges across India",
        highlight_style))
    story.append(Paragraph(
        "All specialties and disciplines welcome",
        body_style))

    story.append(Spacer(1, 0.25*inch))

    # ---- HIGHLIGHTS BOX ----
    story.append(Paragraph("CONFERENCE HIGHLIGHTS", section_head_style))
    story.append(HRFlowable(width="60%", thickness=1.5, color=GOLD, spaceAfter=14))

    highlights = [
        ["Oral Paper Presentations", "Poster Presentations"],
        ["Quiz Competition", "Panel Discussions"],
        ["Guest Lectures by National Faculty", "Best Paper Awards"],
        ["Networking & CME Credit Hours", "Cultural Evening"],
    ]

    hl_style_cell = S("HlCell",
        fontName="Helvetica-Bold", fontSize=15, leading=20,
        textColor=DARK_BLUE, alignment=TA_CENTER)
    hl_body_cell = S("HlBodyCell",
        fontName="Helvetica", fontSize=15, leading=20,
        textColor=DARK_BLUE, alignment=TA_CENTER)

    table_data = []
    for row in highlights:
        table_data.append([
            Paragraph(f"\u2022 {row[0]}", hl_style_cell),
            Paragraph(f"\u2022 {row[1]}", hl_style_cell),
        ])

    hl_table = Table(table_data, colWidths=[6.5*inch, 6.5*inch])
    hl_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), white),
        ("BOX", (0,0), (-1,-1), 1, LIGHT_BLUE),
        ("INNERGRID", (0,0), (-1,-1), 0.5, PALE_BLUE),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [WARM_WHITE, PALE_BLUE]),
        ("TOPPADDING", (0,0), (-1,-1), 10),
        ("BOTTOMPADDING", (0,0), (-1,-1), 10),
        ("LEFTPADDING", (0,0), (-1,-1), 14),
        ("RIGHTPADDING", (0,0), (-1,-1), 14),
    ]))
    story.append(hl_table)
    story.append(Spacer(1, 0.3*inch))

    # ---- ABSTRACT SUBMISSION ----
    story.append(Paragraph("ABSTRACT SUBMISSION", section_head_style))
    story.append(HRFlowable(width="60%", thickness=1.5, color=GOLD, spaceAfter=10))

    abs_data = [
        [
            Paragraph("<b>Last Date to Submit:</b><br/>TBA", highlight_style),
            Paragraph("<b>Mode:</b><br/>Online / Email", highlight_style),
            Paragraph("<b>Categories:</b><br/>Original Research | Case Report | Review", highlight_style),
        ]
    ]
    abs_table = Table(abs_data, colWidths=[4.33*inch, 4.33*inch, 4.34*inch])
    abs_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_GOLD),
        ("BOX", (0,0), (-1,-1), 1.2, GOLD),
        ("INNERGRID", (0,0), (-1,-1), 0.5, GOLD),
        ("TOPPADDING", (0,0), (-1,-1), 14),
        ("BOTTOMPADDING", (0,0), (-1,-1), 14),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ]))
    story.append(abs_table)
    story.append(Spacer(1, 0.3*inch))

    # ---- REGISTRATION ----
    story.append(Paragraph("REGISTRATION", section_head_style))
    story.append(HRFlowable(width="60%", thickness=1.5, color=GOLD, spaceAfter=10))

    reg_data = [
        [
            Paragraph("<b>Registration Fee:</b><br/>TBA", highlight_style),
            Paragraph("<b>Accommodation:</b><br/>Limited seats available", highlight_style),
            Paragraph("<b>Deadline:</b><br/>TBA", highlight_style),
        ]
    ]
    reg_table = Table(reg_data, colWidths=[4.33*inch, 4.33*inch, 4.34*inch])
    reg_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), PALE_BLUE),
        ("BOX", (0,0), (-1,-1), 1.2, LIGHT_BLUE),
        ("INNERGRID", (0,0), (-1,-1), 0.5, LIGHT_BLUE),
        ("TOPPADDING", (0,0), (-1,-1), 14),
        ("BOTTOMPADDING", (0,0), (-1,-1), 14),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
    ]))
    story.append(reg_table)
    story.append(Spacer(1, 0.25*inch))

    # ---- CONTACT / FOOTER (in the blue footer band) ----
    story.append(Spacer(1, 0.1*inch))
    story.append(HRFlowable(width="90%", thickness=1.5, color=GOLD, spaceAfter=10))

    story.append(Paragraph(
        "For queries and registration, contact the Organizing Secretary",
        white_bold_style))
    story.append(Paragraph(
        "Department of General Medicine, R.N.T. Medical College, Udaipur - 313001, Rajasthan",
        small_white))
    story.append(Paragraph(
        "Email: medinova2026@rntmc.edu.in  |  Phone: +91 XXXXX XXXXX",
        small_white))
    story.append(Spacer(1, 0.08*inch))
    story.append(Paragraph(
        "Organized under the auspices of the Department of General Medicine, R.N.T. Medical College",
        small_white))

    # ---- BUILD ----
    def on_first_page(canvas_obj, doc):
        canvas_obj.saveState()
        canvas_obj._draw_background()
        canvas_obj.restoreState()

    def on_later_pages(canvas_obj, doc):
        canvas_obj.saveState()
        canvas_obj._draw_background()
        canvas_obj.restoreState()

    # Use a custom canvas
    doc.build(story, canvasmaker=InviteCanvas)
    print(f"PDF created: {output_path}")


if __name__ == "__main__":
    build_invite()
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite.py 2>&1

Editing File

~/rnt-invite/create_invite.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite.py'
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite.py 2>&1

Editing File

~/rnt-invite/create_invite.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite.py'
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite.py 2>&1

Your conference invitation poster is ready!

RNT PGConference Invite 2026

PDF Document · PDF

Here's what's included in the poster:
Design:
  • Deep navy blue header and footer with gold accents
  • Decorative geometric elements (circles, sidebar strips)
  • Professional A2-size portrait layout
Content sections:
  • Institution: R.N.T. Medical College & M.B. Hospitals, Udaipur (MPUHS)
  • Department of General Medicine
  • Conference name: MEDINOVA 2026 - National PG Residents' Research Conference
  • Dates: 21 & 22 June 2026 (Sunday & Monday)
  • Venue: Conference Hall, R.N.T. Medical College, Udaipur
  • Target audience: PG Residents (MD/MS/DNB) Pan India, all specialties
  • Conference highlights (Oral papers, Poster presentations, Quiz, Guest lectures, Awards, CME credit hours)
  • Abstract submission section (with placeholder fields for dates/email)
  • Registration section (with placeholder fields)
  • Contact/footer block
To customize: Replace "MEDINOVA 2026" with the actual conference name, fill in the registration fee, abstract submission deadline, and contact email/phone number. Let me know if you'd like any changes to colors, layout, or content!

Design an event schedule/timetable poster for the conference days

Running Command

ls /home/daytona/workspace/rnt-invite/

Writing File

~/rnt-invite/create_schedule.py

from reportlab.lib.pagesizes import A2
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor, white, black

output_path = "/home/daytona/workspace/rnt-invite/RNT_Schedule_2026.pdf"

PAGE_WIDTH  = 16.54 * inch   # A2 width
PAGE_HEIGHT = 23.39 * inch   # A2 height

# Colour palette — same brand as invite
DARK_BLUE  = HexColor("#0B2C6E")
GOLD       = HexColor("#C9A227")
LIGHT_BLUE = HexColor("#1E5FAD")
PALE_BLUE  = HexColor("#DDE9F7")
WARM_WHITE = HexColor("#FAFAF5")
MED_GRAY   = HexColor("#444444")
LIGHT_GOLD = HexColor("#F5E6B3")
DAY1_HDR   = HexColor("#1E5FAD")   # blue for Day 1 header
DAY2_HDR   = HexColor("#0B6E4F")   # teal/green for Day 2 header
DAY2_LITE  = HexColor("#D6F0E6")
ORANGE     = HexColor("#C25A12")
PLENARY_BG = HexColor("#E8EFF9")
BREAK_BG   = HexColor("#FFF8E1")
CEREMONY_BG= HexColor("#EDE9F8")
AWARD_BG   = HexColor("#FFEAEA")

# ── Schedule data ─────────────────────────────────────────────────────────────
# Each entry: (time, event, type)
# type keys: 'head' 'plenary' 'session' 'break' 'ceremony' 'award' 'workshop' 'special'
DAY1 = [
    ("08:00 - 09:00", "Registration & Kit Distribution",          "ceremony"),
    ("09:00 - 09:45", "Inaugural Ceremony\n"
                      "Lighting of Lamp | Welcome Address | Chief Guest Address\n"
                      "Release of Souvenir",                       "ceremony"),
    ("09:45 - 10:00", "Inaugural Address by Chief Guest",          "plenary"),
    ("10:00 - 10:15", "Tea / Coffee Break",                        "break"),
    ("10:15 - 11:15", "Keynote Lecture I\n"
                      "\"Recent Advances in Internal Medicine\"\n"
                      "— Distinguished National Faculty",          "plenary"),
    ("11:15 - 13:00", "Oral Paper Presentations — Session I\n"
                      "General Medicine & Allied Specialties\n"
                      "Chairpersons: TBA | Judges: TBA",           "session"),
    ("13:00 - 14:00", "Lunch Break",                               "break"),
    ("14:00 - 14:45", "Keynote Lecture II\n"
                      "\"Evidence-Based Medicine in Clinical Practice\"\n"
                      "— Distinguished National Faculty",          "plenary"),
    ("14:45 - 16:30", "Oral Paper Presentations — Session II\n"
                      "Surgical & Allied Specialties\n"
                      "Chairpersons: TBA | Judges: TBA",           "session"),
    ("16:30 - 16:45", "Tea / Coffee Break",                        "break"),
    ("16:45 - 18:00", "PG Quiz Competition\n"
                      "Prelims & Quarter-Finals\n"
                      "All registered teams",                      "workshop"),
    ("18:00 - 19:00", "Panel Discussion\n"
                      "\"Challenges Faced by PG Residents in India\"\n"
                      "Panelists: National Faculty",               "special"),
    ("19:30 onwards", "Cultural Evening & Dinner",                 "ceremony"),
]

DAY2 = [
    ("08:30 - 09:00", "Registration Desk Open (Late arrivals)",    "ceremony"),
    ("09:00 - 10:00", "Poster Presentation & Judging — Session I\n"
                      "All posters displayed | Judges' round\n"
                      "Authors must be present",                   "session"),
    ("10:00 - 10:15", "Tea / Coffee Break",                        "break"),
    ("10:15 - 11:15", "Keynote Lecture III\n"
                      "\"Artificial Intelligence in Medicine\"\n"
                      "— Distinguished National Faculty",          "plenary"),
    ("11:15 - 12:00", "Poster Presentation — Session II\n"
                      "Open viewing for all delegates",            "session"),
    ("12:00 - 13:00", "Oral Paper Presentations — Session III\n"
                      "Paediatrics, OBG & Allied Specialties",     "session"),
    ("13:00 - 14:00", "Lunch Break",                               "break"),
    ("14:00 - 14:45", "Guest Lecture\n"
                      "\"Research Methodology for PG Residents\"\n"
                      "— Distinguished National Faculty",          "plenary"),
    ("14:45 - 15:30", "PG Quiz — Semi-Finals & Finals",            "workshop"),
    ("15:30 - 15:45", "Tea / Coffee Break",                        "break"),
    ("15:45 - 16:30", "Panel Discussion\n"
                      "\"Postgraduate Medical Education: Way Forward\"",  "special"),
    ("16:30 - 17:30", "Valedictory & Award Ceremony\n"
                      "Best Oral Paper (1st, 2nd, 3rd)\n"
                      "Best Poster (1st, 2nd, 3rd)\n"
                      "Quiz Winners | Best Outstation Delegate",   "award"),
    ("17:30 - 18:00", "Closing Remarks & Vote of Thanks\n"
                      "High Tea / Snacks",                         "ceremony"),
]

# ── Type → colours ────────────────────────────────────────────────────────────
TYPE_COLORS = {
    "plenary":   (PLENARY_BG,  LIGHT_BLUE, DARK_BLUE),
    "session":   (PALE_BLUE,   LIGHT_BLUE, DARK_BLUE),
    "break":     (BREAK_BG,    GOLD,       HexColor("#7A5800")),
    "ceremony":  (CEREMONY_BG, HexColor("#5B4DB5"), HexColor("#2D2470")),
    "award":     (AWARD_BG,    HexColor("#C0392B"), HexColor("#7B0000")),
    "workshop":  (HexColor("#E8F8E8"), HexColor("#1A7A40"), HexColor("#0A4020")),
    "special":   (HexColor("#FFF0E0"), ORANGE, HexColor("#7A2D00")),
}

# ── Canvas with brand chrome ───────────────────────────────────────────────────
class ScheduleCanvas(canvas.Canvas):
    def __init__(self, filename, **kwargs):
        super().__init__(filename, **kwargs)

    def showPage(self):
        self._draw_chrome()
        super().showPage()

    def save(self):
        self._draw_chrome()
        super().save()

    def _draw_chrome(self):
        w, h = self._pagesize

        # background
        self.setFillColor(WARM_WHITE)
        self.rect(0, 0, w, h, fill=1, stroke=0)

        # top header band
        self.setFillColor(DARK_BLUE)
        self.rect(0, h - 2.9*inch, w, 2.9*inch, fill=1, stroke=0)

        # gold top pip
        self.setFillColor(GOLD)
        self.rect(0, h - 0.16*inch, w, 0.16*inch, fill=1, stroke=0)
        # gold bottom of header
        self.setFillColor(GOLD)
        self.rect(0, h - 2.9*inch, w, 0.10*inch, fill=1, stroke=0)

        # bottom footer
        self.setFillColor(DARK_BLUE)
        self.rect(0, 0, w, 1.5*inch, fill=1, stroke=0)
        self.setFillColor(GOLD)
        self.rect(0, 1.5*inch, w, 0.10*inch, fill=1, stroke=0)
        self.setFillColor(GOLD)
        self.rect(0, 0, w, 0.15*inch, fill=1, stroke=0)

        # side strips
        self.setFillColor(LIGHT_BLUE)
        self.rect(0, 1.6*inch, 0.35*inch, h - 4.5*inch, fill=1, stroke=0)
        self.rect(w - 0.35*inch, 1.6*inch, 0.35*inch, h - 4.5*inch, fill=1, stroke=0)

        # decorative circles header left/right
        for cx in [1.1*inch, w - 1.1*inch]:
            self.setFillColor(LIGHT_BLUE);  self.circle(cx, h-1.2*inch, 0.9*inch,  fill=1, stroke=0)
            self.setFillColor(GOLD);         self.circle(cx, h-1.2*inch, 0.62*inch, fill=1, stroke=0)
            self.setFillColor(DARK_BLUE);    self.circle(cx, h-1.2*inch, 0.38*inch, fill=1, stroke=0)


# ── Helper styles ──────────────────────────────────────────────────────────────
def S(name, **kw):
    return ParagraphStyle(name, **kw)

hdr_college = S("hcoll", fontName="Helvetica-Bold",   fontSize=22, leading=26, textColor=white,       alignment=TA_CENTER)
hdr_dept    = S("hdept", fontName="Helvetica",         fontSize=13, leading=17, textColor=LIGHT_GOLD,  alignment=TA_CENTER)
hdr_conf    = S("hconf", fontName="Helvetica-Bold",   fontSize=40, leading=46, textColor=GOLD,        alignment=TA_CENTER, spaceBefore=10, spaceAfter=4)
hdr_sub     = S("hsub",  fontName="Helvetica-BoldOblique", fontSize=17, leading=22, textColor=PALE_BLUE, alignment=TA_CENTER, spaceAfter=6)
day_title   = S("dtt",   fontName="Helvetica-Bold",   fontSize=22, leading=26, textColor=white,       alignment=TA_CENTER)
time_sty    = S("ts",    fontName="Helvetica-Bold",   fontSize=13, leading=16, textColor=MED_GRAY,    alignment=TA_CENTER)
event_sty   = S("es",    fontName="Helvetica-Bold",   fontSize=14, leading=18, textColor=DARK_BLUE,   alignment=TA_LEFT)
event_sub   = S("esub",  fontName="Helvetica",        fontSize=12, leading=16, textColor=MED_GRAY,    alignment=TA_LEFT)
footer_sty  = S("ftr",   fontName="Helvetica",        fontSize=13, leading=17, textColor=LIGHT_GOLD,  alignment=TA_CENTER)
footer_bold = S("ftrb",  fontName="Helvetica-Bold",   fontSize=14, leading=18, textColor=GOLD,        alignment=TA_CENTER)
legend_sty  = S("leg",   fontName="Helvetica",        fontSize=11, leading=14, textColor=MED_GRAY,    alignment=TA_CENTER)

COL_TIME  = 2.2 * inch
COL_EVENT = 11.5 * inch
FULL_W    = COL_TIME + COL_EVENT   # ~13.7 inch


def make_event_cell(time_str, event_str, etype):
    bg, accent, txt_color = TYPE_COLORS.get(etype, (WARM_WHITE, MED_GRAY, DARK_BLUE))

    lines = event_str.split("\n")
    title_para = Paragraph(lines[0], S("et", fontName="Helvetica-Bold", fontSize=14,
                                        leading=18, textColor=txt_color, alignment=TA_LEFT))
    sub_paras  = [Paragraph(ln, S("ess", fontName="Helvetica", fontSize=11.5,
                                   leading=15, textColor=MED_GRAY, alignment=TA_LEFT))
                  for ln in lines[1:] if ln.strip()]

    time_para  = Paragraph(time_str.replace(" - ", "\n"),
                            S("tp", fontName="Helvetica-Bold", fontSize=12, leading=16,
                              textColor=accent, alignment=TA_CENTER))

    cell_content = [title_para] + sub_paras

    inner = Table([[time_para, [cell_content[0]] + cell_content[1:]]],
                  colWidths=[COL_TIME, COL_EVENT])
    inner.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), bg),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("TOPPADDING",   (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0), (-1,-1), 8),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
        ("LINEBEFORE",   (0,0), (0,-1),  3, accent),
        ("LINEABOVE",    (0,0), (-1,0),  0.5, HexColor("#CCCCCC")),
        ("LINEBELOW",    (0,0), (-1,-1), 0.5, HexColor("#CCCCCC")),
    ]))
    return inner


def day_header_table(day_label, date_str, color):
    p1 = Paragraph(day_label, S("dhl", fontName="Helvetica-Bold", fontSize=20, leading=24,
                                  textColor=white, alignment=TA_CENTER))
    p2 = Paragraph(date_str,  S("dhs", fontName="Helvetica",      fontSize=14, leading=18,
                                  textColor=LIGHT_GOLD, alignment=TA_CENTER))
    t  = Table([[p1], [p2]], colWidths=[FULL_W + 0.05*inch])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), color),
        ("TOPPADDING",   (0,0), (-1,-1), 10),
        ("BOTTOMPADDING",(0,0), (-1,-1), 10),
        ("LEFTPADDING",  (0,0), (-1,-1), 14),
        ("RIGHTPADDING", (0,0), (-1,-1), 14),
        ("LINEABOVE",    (0,0), (-1,0),  2.5, GOLD),
        ("LINEBELOW",    (0,0), (-1,-1), 2.5, GOLD),
    ]))
    return t


def build_schedule():
    doc = SimpleDocTemplate(
        output_path,
        pagesize=(PAGE_WIDTH, PAGE_HEIGHT),
        rightMargin=1.4 * inch,
        leftMargin=1.4 * inch,
        topMargin=3.3 * inch,
        bottomMargin=1.9 * inch,
        title="MEDINOVA 2026 — Schedule",
        author="R.N.T. Medical College, Udaipur",
    )

    story = []

    # ── push into header band ──────────────────────────────────────────────────
    story.append(Spacer(1, -2.5*inch))
    story.append(Paragraph("R.N.T. MEDICAL COLLEGE &amp; M.B. HOSPITALS, UDAIPUR", hdr_college))
    story.append(Paragraph("Department of General Medicine", hdr_dept))
    story.append(Paragraph("MEDINOVA 2026", hdr_conf))
    story.append(Paragraph("National PG Residents\u2019 Research Conference  |  21 &amp; 22 June 2026", hdr_sub))
    story.append(Spacer(1, 0.15*inch))

    # ── LEGEND ────────────────────────────────────────────────────────────────
    legend_items = [
        (PLENARY_BG,  LIGHT_BLUE, "Keynote / Plenary"),
        (PALE_BLUE,   LIGHT_BLUE, "Oral / Poster Session"),
        (BREAK_BG,    GOLD,       "Break / Lunch"),
        (CEREMONY_BG, HexColor("#5B4DB5"), "Ceremony / Cultural"),
        (HexColor("#E8F8E8"), HexColor("#1A7A40"), "Quiz / Workshop"),
        (HexColor("#FFF0E0"), ORANGE, "Panel Discussion"),
        (AWARD_BG,    HexColor("#C0392B"), "Award Ceremony"),
    ]
    leg_cells = []
    for bg, acc, label in legend_items:
        swatch = Paragraph("   ", S("sw", fontName="Helvetica", fontSize=11,
                                     backColor=bg, textColor=bg))
        txt    = Paragraph(label, S("lt", fontName="Helvetica", fontSize=11,
                                     leading=14, textColor=MED_GRAY))
        leg_cells.append([swatch, txt])

    leg_table = Table(
        [leg_cells[i:i+4] for i in range(0, len(leg_cells), 4)],
        colWidths=[0.25*inch, 1.8*inch] * 4
    )
    leg_table.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), WARM_WHITE),
        ("BOX",          (0,0), (-1,-1), 0.8, HexColor("#BBBBBB")),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    story.append(leg_table)
    story.append(Spacer(1, 0.25*inch))

    # ── DAY 1 ─────────────────────────────────────────────────────────────────
    story.append(day_header_table("DAY 1 — Sunday, 21 June 2026",
                                   "Inaugural Day", DAY1_HDR))
    story.append(Spacer(1, 0.06*inch))

    for time_str, event_str, etype in DAY1:
        story.append(make_event_cell(time_str, event_str, etype))

    story.append(Spacer(1, 0.35*inch))

    # ── DAY 2 ─────────────────────────────────────────────────────────────────
    story.append(day_header_table("DAY 2 — Monday, 22 June 2026",
                                   "Scientific Sessions & Valedictory", DAY2_HDR))
    story.append(Spacer(1, 0.06*inch))

    for time_str, event_str, etype in DAY2:
        story.append(make_event_cell(time_str, event_str, etype))

    story.append(Spacer(1, 0.25*inch))

    # ── FOOTER NOTE ───────────────────────────────────────────────────────────
    story.append(HRFlowable(width="90%", thickness=1.5, color=GOLD, spaceAfter=8))
    story.append(Paragraph(
        "\u2022 Schedule is subject to change  \u2022  All timings are in Indian Standard Time (IST)  "
        "\u2022  Delegates are requested to be seated 5 minutes before each session",
        S("fn", fontName="Helvetica-Oblique", fontSize=11, leading=15,
          textColor=MED_GRAY, alignment=TA_CENTER)))
    story.append(Spacer(1, 0.08*inch))
    story.append(Paragraph(
        "Venue: Conference Hall, R.N.T. Medical College, Udaipur \u2014 313001, Rajasthan",
        S("vn", fontName="Helvetica-Bold", fontSize=12, leading=16,
          textColor=DARK_BLUE, alignment=TA_CENTER)))
    story.append(Spacer(1, 0.12*inch))
    story.append(Paragraph(
        "Organized by Department of General Medicine, R.N.T. Medical College, Udaipur",
        S("org", fontName="Helvetica", fontSize=11, leading=15,
          textColor=HexColor("#777777"), alignment=TA_CENTER)))

    doc.build(story, canvasmaker=ScheduleCanvas)
    print(f"Schedule PDF created: {output_path}")


if __name__ == "__main__":
    build_schedule()
Running Command

cd /home/daytona/workspace/rnt-invite && python create_schedule.py 2>&1

Your schedule poster is ready!

RNT Schedule 2026

PDF Document · PDF


Here's what's on the two-day timetable:
Day 1 - Sunday, 21 June 2026 (Inaugural Day)
TimeEvent
08:00 - 09:00Registration & Kit Distribution
09:00 - 09:45Inaugural Ceremony (Lamp lighting, Welcome, Chief Guest, Souvenir release)
10:15 - 11:15Keynote Lecture I - Recent Advances in Internal Medicine
11:15 - 13:00Oral Paper Presentations - Session I (General Medicine)
14:00 - 14:45Keynote Lecture II - Evidence-Based Medicine
14:45 - 16:30Oral Paper Presentations - Session II (Surgical Specialties)
16:45 - 18:00PG Quiz - Prelims & Quarter Finals
18:00 - 19:00Panel Discussion - Challenges for PG Residents
19:30 onwardsCultural Evening & Dinner
Day 2 - Monday, 22 June 2026 (Scientific Sessions & Valedictory)
TimeEvent
09:00 - 10:00Poster Presentation & Judging - Session I
10:15 - 11:15Keynote Lecture III - AI in Medicine
11:15 - 13:00Poster Session II + Oral Session III (Paediatrics, OBG)
14:00 - 14:45Guest Lecture - Research Methodology for PG Residents
14:45 - 15:30Quiz Semi-Finals & Finals
15:45 - 16:30Panel Discussion - PG Medical Education
16:30 - 17:30Valedictory & Award Ceremony (Best Paper, Poster, Quiz)
17:30 - 18:00Closing Remarks & High Tea
Design features: Colour-coded event types (blue = lectures, pale blue = paper sessions, gold = breaks, purple = ceremonies, red = awards, green = quiz, orange = panels), a legend key, branded header/footer matching the invite, and a note reminding delegates that timings are subject to change.
Let me know if you'd like to adjust any timings, add specific faculty names, or tweak the design!

Pdf is blank kindly add all the details

Writing File

~/rnt-invite/create_schedule_v2.py

"""
RNT Medical College - MEDINOVA 2026
Conference Schedule Poster - Pure canvas drawing approach
A2 portrait, all content drawn directly - no blank page issues
"""

from reportlab.pdfgen import canvas
from reportlab.lib.units import inch, cm
from reportlab.lib.colors import HexColor, white, black
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.utils import simpleSplit

output_path = "/home/daytona/workspace/rnt-invite/RNT_Schedule_2026.pdf"

# A2 portrait
W = 16.54 * inch
H = 23.39 * inch

# ── Colour palette ─────────────────────────────────────────────────────────────
DARK_BLUE  = HexColor("#0B2C6E")
GOLD       = HexColor("#C9A227")
LIGHT_BLUE = HexColor("#1E5FAD")
PALE_BLUE  = HexColor("#DDE9F7")
WARM_WHITE = HexColor("#FAFAF5")
MED_GRAY   = HexColor("#444444")
LIGHT_GOLD = HexColor("#F5E6B3")
DAY1_COL   = HexColor("#1E5FAD")
DAY2_COL   = HexColor("#0B6E4F")

TYPE_BG = {
    "plenary":   (HexColor("#E8EFF9"), LIGHT_BLUE),
    "session":   (PALE_BLUE,           LIGHT_BLUE),
    "break":     (HexColor("#FFF8E1"), GOLD),
    "ceremony":  (HexColor("#EDE9F8"), HexColor("#5B4DB5")),
    "award":     (HexColor("#FFEAEA"), HexColor("#C0392B")),
    "workshop":  (HexColor("#E8F8E8"), HexColor("#1A7A40")),
    "special":   (HexColor("#FFF0E0"), HexColor("#C25A12")),
}

# ── Schedule data ──────────────────────────────────────────────────────────────
DAY1 = [
    ("08:00 - 09:00", "Registration & Kit Distribution",
     ["Welcome desk open | Delegate kits, badges & souvenir handed out"], "ceremony"),

    ("09:00 - 09:45", "Inaugural Ceremony",
     ["Lighting of Lamp | Welcome Address by Head of Department",
      "Address by Principal, R.N.T. Medical College",
      "Chief Guest Address | Release of Conference Souvenir"], "ceremony"),

    ("09:45 - 10:00", "Inaugural Address by Chief Guest", [], "plenary"),

    ("10:00 - 10:15", "Tea / Coffee Break", [], "break"),

    ("10:15 - 11:15", "Keynote Lecture I",
     ['"Recent Advances in Internal Medicine"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("11:15 - 13:00", "Oral Paper Presentations — Session I",
     ["General Medicine & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("13:00 - 14:00", "Lunch Break", ["Delegates' Dining Hall"], "break"),

    ("14:00 - 14:45", "Keynote Lecture II",
     ['"Evidence-Based Medicine in Clinical Practice"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("14:45 - 16:30", "Oral Paper Presentations — Session II",
     ["Surgical & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("16:30 - 16:45", "Tea / Coffee Break", [], "break"),

    ("16:45 - 18:00", "PG Quiz Competition",
     ["Prelims & Quarter-Finals  |  All registered teams participate"], "workshop"),

    ("18:00 - 19:00", "Panel Discussion",
     ['"Challenges Faced by PG Residents in India"',
      "Panelists: Distinguished National Faculty"], "special"),

    ("19:30 onwards", "Cultural Evening & Gala Dinner",
     ["All delegates invited"], "ceremony"),
]

DAY2 = [
    ("08:30 - 09:00", "Registration Desk Open",
     ["Late arrivals  |  Badge collection"], "ceremony"),

    ("09:00 - 10:00", "Poster Presentation & Judging — Session I",
     ["All posters displayed in the poster hall",
      "Authors must be present at their posters during judges' round"], "session"),

    ("10:00 - 10:15", "Tea / Coffee Break", [], "break"),

    ("10:15 - 11:15", "Keynote Lecture III",
     ['"Artificial Intelligence in Medicine: Present & Future"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("11:15 - 12:00", "Poster Presentation — Session II",
     ["Open viewing for all delegates  |  Interact with authors"], "session"),

    ("12:00 - 13:00", "Oral Paper Presentations — Session III",
     ["Paediatrics, OBG & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("13:00 - 14:00", "Lunch Break", ["Delegates' Dining Hall"], "break"),

    ("14:00 - 14:45", "Guest Lecture",
     ['"Research Methodology for PG Residents"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("14:45 - 15:30", "PG Quiz — Semi-Finals & Finals",
     ["Top teams from Day 1 Prelims"], "workshop"),

    ("15:30 - 15:45", "Tea / Coffee Break", [], "break"),

    ("15:45 - 16:30", "Panel Discussion",
     ['"Postgraduate Medical Education: The Way Forward"',
      "Panelists: Distinguished National Faculty"], "special"),

    ("16:30 - 17:30", "Valedictory & Award Ceremony",
     ["Best Oral Paper: 1st, 2nd & 3rd  |  Best Poster: 1st, 2nd & 3rd",
      "Quiz Winners  |  Best Outstation Delegate  |  Certificates to all"], "award"),

    ("17:30 - 18:00", "Closing Remarks, Vote of Thanks & High Tea",
     ["Presented by Organizing Secretary"], "ceremony"),
]

LEGEND = [
    (HexColor("#E8EFF9"), LIGHT_BLUE,           "Keynote / Plenary Lecture"),
    (PALE_BLUE,           LIGHT_BLUE,           "Oral / Poster Presentation"),
    (HexColor("#FFF8E1"), GOLD,                 "Break / Lunch"),
    (HexColor("#EDE9F8"), HexColor("#5B4DB5"),  "Ceremony / Cultural"),
    (HexColor("#E8F8E8"), HexColor("#1A7A40"),  "Quiz / Workshop"),
    (HexColor("#FFF0E0"), HexColor("#C25A12"),  "Panel Discussion"),
    (HexColor("#FFEAEA"), HexColor("#C0392B"),  "Award Ceremony"),
]

# ── Drawing helpers ────────────────────────────────────────────────────────────
def draw_text_wrapped(c, text, x, y, max_width, font, size, color, line_height=None):
    """Draw word-wrapped text, return new y after drawing."""
    if line_height is None:
        line_height = size * 1.35
    c.setFont(font, size)
    c.setFillColor(color)
    lines = simpleSplit(text, font, size, max_width)
    for line in lines:
        c.drawString(x, y, line)
        y -= line_height
    return y

def draw_centered_wrapped(c, text, cx, y, max_width, font, size, color, line_height=None):
    if line_height is None:
        line_height = size * 1.35
    c.setFont(font, size)
    c.setFillColor(color)
    lines = simpleSplit(text, font, size, max_width)
    for line in lines:
        c.drawCentredString(cx, y, line)
        y -= line_height
    return y

def text_height(text, font, size, max_width, line_height=None):
    if line_height is None:
        line_height = size * 1.35
    lines = simpleSplit(text, font, size, max_width)
    return len(lines) * line_height

def measure_row_height(time_str, title, subs, etype, time_col_w, event_col_w, pad=10):
    """Measure the height needed for one schedule row."""
    title_h  = text_height(title,    "Helvetica-Bold", 13.5, event_col_w - 2*pad)
    sub_h    = sum(text_height(s, "Helvetica", 11, event_col_w - 2*pad) for s in subs)
    time_h   = text_height(time_str.replace(" - ", "\n"), "Helvetica-Bold", 11, time_col_w - 2*pad)
    content_h = title_h + sub_h + (4 * len(subs)) + 2*pad
    row_h = max(content_h, time_h + 2*pad, 36)
    return row_h

# ── Main drawing function ──────────────────────────────────────────────────────
def draw_page(c):
    # ── Background ─────────────────────────────────────────────────────────────
    c.setFillColor(WARM_WHITE)
    c.rect(0, 0, W, H, fill=1, stroke=0)

    # ── TOP HEADER BAND ────────────────────────────────────────────────────────
    HEADER_H = 2.55 * inch
    c.setFillColor(DARK_BLUE)
    c.rect(0, H - HEADER_H, W, HEADER_H, fill=1, stroke=0)
    # gold top pip
    c.setFillColor(GOLD)
    c.rect(0, H - 0.14*inch, W, 0.14*inch, fill=1, stroke=0)
    # gold bottom of header
    c.setFillColor(GOLD)
    c.rect(0, H - HEADER_H, W, 0.09*inch, fill=1, stroke=0)

    # decorative circles in header
    for cx_pos in [1.05*inch, W - 1.05*inch]:
        c.setFillColor(LIGHT_BLUE); c.circle(cx_pos, H - 1.1*inch, 0.82*inch, fill=1, stroke=0)
        c.setFillColor(GOLD);       c.circle(cx_pos, H - 1.1*inch, 0.56*inch, fill=1, stroke=0)
        c.setFillColor(DARK_BLUE);  c.circle(cx_pos, H - 1.1*inch, 0.34*inch, fill=1, stroke=0)

    # header text
    cy = H - 0.52*inch
    c.setFont("Helvetica-Bold", 20)
    c.setFillColor(white)
    c.drawCentredString(W/2, cy, "R.N.T. MEDICAL COLLEGE & M.B. HOSPITALS, UDAIPUR")
    cy -= 0.27*inch
    c.setFont("Helvetica", 12.5)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, cy, "Department of General Medicine  |  Maharana Pratap University of Health Sciences")
    cy -= 0.42*inch
    c.setFont("Helvetica-Bold", 38)
    c.setFillColor(GOLD)
    c.drawCentredString(W/2, cy, "MEDINOVA 2026")
    cy -= 0.38*inch
    c.setFont("Helvetica-BoldOblique", 15.5)
    c.setFillColor(PALE_BLUE)
    c.drawCentredString(W/2, cy, "National PG Residents' Research Conference  —  Event Schedule")
    cy -= 0.26*inch
    c.setFont("Helvetica-Bold", 13)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, cy, "21 & 22 June 2026  |  Conference Hall, R.N.T. Medical College, Udaipur")

    # ── FOOTER BAND ────────────────────────────────────────────────────────────
    FOOTER_H = 1.3 * inch
    c.setFillColor(DARK_BLUE)
    c.rect(0, 0, W, FOOTER_H, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, FOOTER_H, W, 0.09*inch, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, 0, W, 0.13*inch, fill=1, stroke=0)

    # footer text
    c.setFont("Helvetica-Bold", 13)
    c.setFillColor(GOLD)
    c.drawCentredString(W/2, FOOTER_H - 0.32*inch,
        "Venue: Conference Hall, R.N.T. Medical College, Udaipur — 313001, Rajasthan")
    c.setFont("Helvetica", 11)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, FOOTER_H - 0.57*inch,
        "Schedule subject to change  |  All timings in IST  |  Delegates requested to be seated 5 min before each session")
    c.setFont("Helvetica-Oblique", 10.5)
    c.setFillColor(HexColor("#AACCEE"))
    c.drawCentredString(W/2, FOOTER_H - 0.79*inch,
        "Organized by Dept. of General Medicine, R.N.T. Medical College  |  Contact: medinova2026@rntmc.edu.in")

    # ── SIDE STRIPS ────────────────────────────────────────────────────────────
    strip_top    = H - HEADER_H - 0.09*inch
    strip_bottom = FOOTER_H + 0.09*inch
    c.setFillColor(LIGHT_BLUE)
    c.rect(0,          strip_bottom, 0.30*inch, strip_top - strip_bottom, fill=1, stroke=0)
    c.rect(W - 0.30*inch, strip_bottom, 0.30*inch, strip_top - strip_bottom, fill=1, stroke=0)

    # ── CONTENT AREA ───────────────────────────────────────────────────────────
    LEFT_M   = 0.55 * inch
    RIGHT_M  = 0.55 * inch
    CONTENT_W = W - LEFT_M - RIGHT_M

    TIME_COL  = 1.95 * inch
    EVENT_COL = CONTENT_W - TIME_COL
    PAD       = 9

    # Start y just below header
    y = H - HEADER_H - 0.18*inch

    # ── LEGEND ─────────────────────────────────────────────────────────────────
    leg_box_h = 0.50 * inch
    c.setFillColor(HexColor("#F0F4FA"))
    c.setStrokeColor(HexColor("#BBBBBB"))
    c.setLineWidth(0.5)
    c.rect(LEFT_M, y - leg_box_h, CONTENT_W, leg_box_h, fill=1, stroke=1)

    leg_item_w = CONTENT_W / len(LEGEND)
    lx = LEFT_M + 6
    ly_center = y - leg_box_h/2
    for (bg, acc, label) in LEGEND:
        # colour swatch
        c.setFillColor(bg)
        c.setStrokeColor(acc)
        c.setLineWidth(1.5)
        c.rect(lx, ly_center - 7, 14, 14, fill=1, stroke=1)
        c.setFont("Helvetica", 9.5)
        c.setFillColor(MED_GRAY)
        c.drawString(lx + 18, ly_center - 4, label)
        lx += leg_item_w

    y -= leg_box_h + 0.18*inch

    # ── Draw schedule rows for one day ─────────────────────────────────────────
    def draw_day(day_data, day_label, date_str, day_color, start_y):
        curr_y = start_y

        # Day header bar
        DAY_HDR_H = 0.48 * inch
        c.setFillColor(day_color)
        c.rect(LEFT_M, curr_y - DAY_HDR_H, CONTENT_W, DAY_HDR_H, fill=1, stroke=0)
        c.setFillColor(GOLD)
        c.rect(LEFT_M, curr_y, CONTENT_W, 0.08*inch, fill=1, stroke=0)
        c.rect(LEFT_M, curr_y - DAY_HDR_H, CONTENT_W, 0.08*inch, fill=1, stroke=0)
        c.setFont("Helvetica-Bold", 17)
        c.setFillColor(white)
        c.drawCentredString(W/2, curr_y - 0.22*inch, day_label)
        c.setFont("Helvetica", 12)
        c.setFillColor(LIGHT_GOLD)
        c.drawCentredString(W/2, curr_y - 0.38*inch, date_str)
        curr_y -= DAY_HDR_H + 0.07*inch

        for (time_str, title, subs, etype) in day_data:
            bg_col, acc_col = TYPE_BG.get(etype, (WARM_WHITE, MED_GRAY))

            # Measure row height
            title_lines  = simpleSplit(title, "Helvetica-Bold", 13.5, EVENT_COL - 2*PAD - 4)
            sub_lines_list = [simpleSplit(s, "Helvetica", 11, EVENT_COL - 2*PAD - 4) for s in subs]
            time_parts   = time_str.split(" - ")
            time_lines   = time_parts if len(time_parts) == 2 else [time_str]

            content_h = len(title_lines) * 16.5
            for sl in sub_lines_list:
                content_h += len(sl) * 14 + 3
            if subs:
                content_h += 4  # gap between title and subs

            row_h = max(content_h + 2*PAD, len(time_lines) * 15 + 2*PAD, 42)

            # Row background
            c.setFillColor(bg_col)
            c.rect(LEFT_M, curr_y - row_h, CONTENT_W, row_h, fill=1, stroke=0)

            # Accent left border on time column
            c.setFillColor(acc_col)
            c.rect(LEFT_M, curr_y - row_h, 4, row_h, fill=1, stroke=0)

            # Thin horizontal separator
            c.setStrokeColor(HexColor("#CCCCCC"))
            c.setLineWidth(0.4)
            c.line(LEFT_M, curr_y, LEFT_M + CONTENT_W, curr_y)

            # Vertical divider between time and event
            c.setStrokeColor(HexColor("#BBBBBB"))
            c.setLineWidth(0.4)
            c.line(LEFT_M + TIME_COL, curr_y - row_h, LEFT_M + TIME_COL, curr_y)

            # Draw time text (centred in time column)
            text_start_y = curr_y - PAD
            c.setFont("Helvetica-Bold", 11.5)
            c.setFillColor(acc_col)
            time_cx = LEFT_M + TIME_COL / 2
            if len(time_parts) == 2:
                c.drawCentredString(time_cx, text_start_y - 4, time_parts[0])
                c.setFont("Helvetica", 9.5)
                c.setFillColor(MED_GRAY)
                c.drawCentredString(time_cx, text_start_y - 18, "to")
                c.setFont("Helvetica-Bold", 11.5)
                c.setFillColor(acc_col)
                c.drawCentredString(time_cx, text_start_y - 32, time_parts[1])
            else:
                c.drawCentredString(time_cx, text_start_y - 8, time_str)

            # Draw title
            ex = LEFT_M + TIME_COL + PAD + 4
            ey = curr_y - PAD - 2
            c.setFont("Helvetica-Bold", 13.5)
            c.setFillColor(DARK_BLUE)
            for tline in title_lines:
                c.drawString(ex, ey, tline)
                ey -= 16.5

            # Draw sub-lines
            if subs:
                ey -= 4
                for sub_text in subs:
                    sub_lines = simpleSplit(sub_text, "Helvetica", 11, EVENT_COL - 2*PAD - 4)
                    c.setFont("Helvetica", 11)
                    c.setFillColor(MED_GRAY)
                    for sl in sub_lines:
                        c.drawString(ex, ey, sl)
                        ey -= 14
                    ey -= 3

            curr_y -= row_h

        return curr_y

    # Draw Day 1
    y = draw_day(DAY1, "DAY 1  —  Sunday, 21 June 2026", "Inaugural Day", DAY1_COL, y)
    y -= 0.28 * inch

    # Draw Day 2
    y = draw_day(DAY2, "DAY 2  —  Monday, 22 June 2026",
                 "Scientific Sessions & Valedictory Day", DAY2_COL, y)


def build():
    c = canvas.Canvas(output_path, pagesize=(W, H))
    draw_page(c)
    c.save()
    print(f"Schedule PDF created: {output_path}")


if __name__ == "__main__":
    build()
Running Command

cd /home/daytona/workspace/rnt-invite && python create_schedule_v2.py 2>&1

Running Command

cd /home/daytona/workspace/rnt-invite && python -c " from reportlab.lib.units import inch from reportlab.lib.utils import simpleSplit W = 16.54 * inch H = 23.39 * inch LEFT_M = 0.55 * inch RIGHT_M = 0.55 * inch CONTENT_W = W - LEFT_M - RIGHT_M TIME_COL = 1.95 * inch EVENT_COL = CONTENT_W - TIME_COL PAD = 9 HEADER_H = 2.55 * inch FOOTER_H = 1.3 * inch LEG_H = 0.50 * inch DAY_HDR = 0.48 * inch available = H - HEADER_H - FOOTER_H - 0.18*inch - LEG_H - 0.18*inch print(f'Available height for both days: {available/inch:.2f} inches') DAY1 = [ ('08:00 - 09:00', 'Registration & Kit Distribution', ['Welcome desk open | Delegate kits, badges & souvenir handed out'], 'ceremony'), ('09:00 - 09:45', 'Inaugural Ceremony', ['Lighting of Lamp | Welcome Address by Head of Department', 'Address by Principal, R.N.T. Medical College', 'Chief Guest Address | Release of Conference Souvenir'], 'ceremony'), ('09:45 - 10:00', 'Inaugural Address by Chief Guest', [], 'plenary'), ('10:00 - 10:15', 'Tea / Coffee Break', [], 'break'), ('10:15 - 11:15', 'Keynote Lecture I', ['\"Recent Advances in Internal Medicine\"', 'Distinguished National Faculty (TBA)'], 'plenary'), ('11:15 - 13:00', 'Oral Paper Presentations — Session I', ['General Medicine & Allied Specialties', 'Chairpersons: TBA | Judges: TBA'], 'session'), ('13:00 - 14:00', 'Lunch Break', ['Delegates Dining Hall'], 'break'), ('14:00 - 14:45', 'Keynote Lecture II', ['\"Evidence-Based Medicine in Clinical Practice\"', 'Distinguished National Faculty (TBA)'], 'plenary'), ('14:45 - 16:30', 'Oral Paper Presentations — Session II', ['Surgical & Allied Specialties', 'Chairpersons: TBA | Judges: TBA'], 'session'), ('16:30 - 16:45', 'Tea / Coffee Break', [], 'break'), ('16:45 - 18:00', 'PG Quiz Competition', ['Prelims & Quarter-Finals | All registered teams participate'], 'workshop'), ('18:00 - 19:00', 'Panel Discussion', ['\"Challenges Faced by PG Residents in India\"', 'Panelists: Distinguished National Faculty'], 'special'), ('19:30 onwards', 'Cultural Evening & Gala Dinner', ['All delegates invited'], 'ceremony'), ] DAY2 = [ ('08:30 - 09:00', 'Registration Desk Open', ['Late arrivals | Badge collection'], 'ceremony'), ('09:00 - 10:00', 'Poster Presentation & Judging — Session I', ['All posters displayed in the poster hall', 'Authors must be present at their posters during judges round'], 'session'), ('10:00 - 10:15', 'Tea / Coffee Break', [], 'break'), ('10:15 - 11:15', 'Keynote Lecture III', ['\"Artificial Intelligence in Medicine: Present & Future\"', 'Distinguished National Faculty (TBA)'], 'plenary'), ('11:15 - 12:00', 'Poster Presentation — Session II', ['Open viewing for all delegates | Interact with authors'], 'session'), ('12:00 - 13:00', 'Oral Paper Presentations — Session III', ['Paediatrics, OBG & Allied Specialties', 'Chairpersons: TBA | Judges: TBA'], 'session'), ('13:00 - 14:00', 'Lunch Break', ['Delegates Dining Hall'], 'break'), ('14:00 - 14:45', 'Guest Lecture', ['\"Research Methodology for PG Residents\"', 'Distinguished National Faculty (TBA)'], 'plenary'), ('14:45 - 15:30', 'PG Quiz — Semi-Finals & Finals', ['Top teams from Day 1 Prelims'], 'workshop'), ('15:30 - 15:45', 'Tea / Coffee Break', [], 'break'), ('15:45 - 16:30', 'Panel Discussion', ['\"Postgraduate Medical Education: The Way Forward\"', 'Panelists: Distinguished National Faculty'], 'special'), ('16:30 - 17:30', 'Valedictory & Award Ceremony', ['Best Oral Paper: 1st, 2nd & 3rd | Best Poster: 1st, 2nd & 3rd', 'Quiz Winners | Best Outstation Delegate | Certificates to all'], 'award'), ('17:30 - 18:00', 'Closing Remarks, Vote of Thanks & High Tea', ['Presented by Organizing Secretary'], 'ceremony'), ] total_h = 0 for day_data in [DAY1, DAY2]: total_h += DAY_HDR + 0.07*inch for (time_str, title, subs, etype) in day_data: title_lines = simpleSplit(title, 'Helvetica-Bold', 13.5, EVENT_COL - 2*PAD - 4) sub_lines_list = [simpleSplit(s, 'Helvetica', 11, EVENT_COL - 2*PAD - 4) for s in subs] content_h = len(title_lines) * 16.5 for sl in sub_lines_list: content_h += len(sl) * 14 + 3 if subs: content_h += 4 row_h = max(content_h + 2*PAD, 42) total_h += row_h total_h += 0.28*inch print(f'Total content height needed: {total_h/inch:.2f} inches') print(f'Fits: {total_h <= available}') print(f'Overflow by: {(total_h - available)/inch:.2f} inches') " 2>&1

Writing File

~/rnt-invite/create_schedule_v3.py

"""
RNT Medical College - MEDINOVA 2026
Conference Schedule Poster - 2-page PDF
Day 1 on Page 1, Day 2 on Page 2
Pure canvas approach — no blank page issues
"""

from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
from reportlab.lib.colors import HexColor, white
from reportlab.lib.utils import simpleSplit

output_path = "/home/daytona/workspace/rnt-invite/RNT_Schedule_2026.pdf"

W = 16.54 * inch   # A2 width
H = 23.39 * inch   # A2 height

# Colours
DARK_BLUE  = HexColor("#0B2C6E")
GOLD       = HexColor("#C9A227")
LIGHT_BLUE = HexColor("#1E5FAD")
PALE_BLUE  = HexColor("#DDE9F7")
WARM_WHITE = HexColor("#FAFAF5")
MED_GRAY   = HexColor("#444444")
LIGHT_GOLD = HexColor("#F5E6B3")
DAY1_COL   = HexColor("#1E5FAD")
DAY2_COL   = HexColor("#0B6E4F")

TYPE_BG = {
    "plenary":   (HexColor("#E8EFF9"), LIGHT_BLUE),
    "session":   (PALE_BLUE,           LIGHT_BLUE),
    "break":     (HexColor("#FFF8E1"), GOLD),
    "ceremony":  (HexColor("#EDE9F8"), HexColor("#5B4DB5")),
    "award":     (HexColor("#FFEAEA"), HexColor("#C0392B")),
    "workshop":  (HexColor("#E8F8E8"), HexColor("#1A7A40")),
    "special":   (HexColor("#FFF0E0"), HexColor("#C25A12")),
}

LEGEND = [
    (HexColor("#E8EFF9"), LIGHT_BLUE,           "Keynote / Plenary"),
    (PALE_BLUE,           LIGHT_BLUE,           "Oral / Poster Session"),
    (HexColor("#FFF8E1"), GOLD,                 "Break / Lunch"),
    (HexColor("#EDE9F8"), HexColor("#5B4DB5"),  "Ceremony / Cultural"),
    (HexColor("#E8F8E8"), HexColor("#1A7A40"),  "Quiz / Workshop"),
    (HexColor("#FFF0E0"), HexColor("#C25A12"),  "Panel Discussion"),
    (HexColor("#FFEAEA"), HexColor("#C0392B"),  "Award Ceremony"),
]

DAY1 = [
    ("08:00", "09:00", "Registration & Kit Distribution",
     ["Welcome desk open  |  Delegate kits, ID badges & souvenir distributed"], "ceremony"),

    ("09:00", "09:45", "Inaugural Ceremony",
     ["Lighting of Lamp  |  Welcome Address by Head of Department",
      "Address by Principal, R.N.T. Medical College",
      "Chief Guest Address  |  Release of Conference Souvenir"], "ceremony"),

    ("09:45", "10:00", "Inaugural Address — Chief Guest", [], "plenary"),

    ("10:00", "10:15", "Tea / Coffee Break", [], "break"),

    ("10:15", "11:15", "Keynote Lecture I — Recent Advances in Internal Medicine",
     ["Distinguished National Faculty (TBA)"], "plenary"),

    ("11:15", "13:00", "Oral Paper Presentations — Session I",
     ["General Medicine & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("13:00", "14:00", "Lunch Break", ["Delegates' Dining Hall"], "break"),

    ("14:00", "14:45", "Keynote Lecture II — Evidence-Based Medicine in Clinical Practice",
     ["Distinguished National Faculty (TBA)"], "plenary"),

    ("14:45", "16:30", "Oral Paper Presentations — Session II",
     ["Surgical & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("16:30", "16:45", "Tea / Coffee Break", [], "break"),

    ("16:45", "18:00", "PG Quiz Competition — Prelims & Quarter-Finals",
     ["All registered teams  |  Conducted by Quiz Committee"], "workshop"),

    ("18:00", "19:00", "Panel Discussion",
     ['"Challenges Faced by PG Residents in India"',
      "Panelists: Distinguished National Faculty"], "special"),

    ("19:30", "onwards", "Cultural Evening & Gala Dinner",
     ["All delegates invited  |  Traditional performances & networking"], "ceremony"),
]

DAY2 = [
    ("08:30", "09:00", "Registration Desk Open",
     ["Late arrivals welcome  |  Badge & kit collection"], "ceremony"),

    ("09:00", "10:00", "Poster Presentation & Judging — Session I",
     ["All posters displayed in the Poster Hall",
      "Authors MUST be present at their posters during judges' round"], "session"),

    ("10:00", "10:15", "Tea / Coffee Break", [], "break"),

    ("10:15", "11:15", "Keynote Lecture III — Artificial Intelligence in Medicine",
     ['"Present Applications & Future Directions"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("11:15", "12:00", "Poster Presentation — Session II",
     ["Open viewing for all delegates  |  Authors available for interaction"], "session"),

    ("12:00", "13:00", "Oral Paper Presentations — Session III",
     ["Paediatrics, OBG & Allied Specialties",
      "Chairpersons: TBA  |  Judges: TBA"], "session"),

    ("13:00", "14:00", "Lunch Break", ["Delegates' Dining Hall"], "break"),

    ("14:00", "14:45", "Guest Lecture — Research Methodology for PG Residents",
     ['"From Idea to Publication: A Step-by-Step Guide"',
      "Distinguished National Faculty (TBA)"], "plenary"),

    ("14:45", "15:30", "PG Quiz — Semi-Finals & Finals",
     ["Top qualifying teams from Day 1  |  Live audience participation"], "workshop"),

    ("15:30", "15:45", "Tea / Coffee Break", [], "break"),

    ("15:45", "16:30", "Panel Discussion",
     ['"Postgraduate Medical Education in India: The Way Forward"',
      "Panelists: Distinguished National Faculty"], "special"),

    ("16:30", "17:30", "Valedictory & Award Ceremony",
     ["Best Oral Paper: Gold, Silver & Bronze  |  Best Poster: Gold, Silver & Bronze",
      "Quiz Champions  |  Best Outstation Delegate  |  Certificates distributed to all"], "award"),

    ("17:30", "18:00", "Closing Remarks, Vote of Thanks & High Tea",
     ["Presented by Organizing Secretary, Dept. of General Medicine"], "ceremony"),
]

# ─────────────────────────────────────────────────────────────────────────────
LEFT_M    = 0.60 * inch
RIGHT_M   = 0.60 * inch
CONTENT_W = W - LEFT_M - RIGHT_M
TIME_COL  = 1.70 * inch
EVENT_COL = CONTENT_W - TIME_COL
PAD       = 8
HEADER_H  = 2.50 * inch
FOOTER_H  = 1.20 * inch
DAY_HDR_H = 0.45 * inch


def draw_chrome(c, day_num):
    """Draw background, header, footer, side strips."""
    # Background
    c.setFillColor(WARM_WHITE)
    c.rect(0, 0, W, H, fill=1, stroke=0)

    # Header band
    c.setFillColor(DARK_BLUE)
    c.rect(0, H - HEADER_H, W, HEADER_H, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, H - 0.13*inch, W, 0.13*inch, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, H - HEADER_H, W, 0.09*inch, fill=1, stroke=0)

    # Decorative circles
    for cx in [1.0*inch, W - 1.0*inch]:
        c.setFillColor(LIGHT_BLUE); c.circle(cx, H - 1.1*inch, 0.80*inch, fill=1, stroke=0)
        c.setFillColor(GOLD);       c.circle(cx, H - 1.1*inch, 0.55*inch, fill=1, stroke=0)
        c.setFillColor(DARK_BLUE);  c.circle(cx, H - 1.1*inch, 0.32*inch, fill=1, stroke=0)

    # Header text
    cy = H - 0.50*inch
    c.setFont("Helvetica-Bold", 19)
    c.setFillColor(white)
    c.drawCentredString(W/2, cy, "R.N.T. MEDICAL COLLEGE & M.B. HOSPITALS, UDAIPUR")
    cy -= 0.26*inch
    c.setFont("Helvetica", 12)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, cy, "Department of General Medicine  |  Maharana Pratap University of Health Sciences")
    cy -= 0.40*inch
    c.setFont("Helvetica-Bold", 36)
    c.setFillColor(GOLD)
    c.drawCentredString(W/2, cy, "MEDINOVA 2026")
    cy -= 0.36*inch
    c.setFont("Helvetica-BoldOblique", 15)
    c.setFillColor(PALE_BLUE)
    c.drawCentredString(W/2, cy, "National PG Residents' Research Conference  —  Event Schedule")
    cy -= 0.25*inch
    c.setFont("Helvetica-Bold", 13)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, cy, "21 & 22 June 2026  |  Conference Hall, R.N.T. Medical College, Udaipur")

    # Page indicator
    page_label = f"Page {day_num} of 2  —  Day {day_num}"
    c.setFont("Helvetica-Oblique", 10)
    c.setFillColor(HexColor("#AACCEE"))
    c.drawCentredString(W/2, H - HEADER_H + 0.18*inch, page_label)

    # Footer band
    c.setFillColor(DARK_BLUE)
    c.rect(0, 0, W, FOOTER_H, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, FOOTER_H, W, 0.08*inch, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(0, 0, W, 0.12*inch, fill=1, stroke=0)

    c.setFont("Helvetica-Bold", 12.5)
    c.setFillColor(GOLD)
    c.drawCentredString(W/2, FOOTER_H - 0.30*inch,
        "Venue: Conference Hall, R.N.T. Medical College, Udaipur — 313001, Rajasthan")
    c.setFont("Helvetica", 10.5)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, FOOTER_H - 0.52*inch,
        "Schedule subject to change  |  All timings in IST  |  Please be seated 5 min before each session")
    c.setFont("Helvetica-Oblique", 10)
    c.setFillColor(HexColor("#AACCEE"))
    c.drawCentredString(W/2, FOOTER_H - 0.73*inch,
        "Contact: medinova2026@rntmc.edu.in  |  Organized by Dept. of General Medicine, R.N.T. Medical College")

    # Side strips
    strip_top = H - HEADER_H - 0.09*inch
    strip_bot = FOOTER_H + 0.09*inch
    c.setFillColor(LIGHT_BLUE)
    c.rect(0,            strip_bot, 0.28*inch, strip_top - strip_bot, fill=1, stroke=0)
    c.rect(W - 0.28*inch, strip_bot, 0.28*inch, strip_top - strip_bot, fill=1, stroke=0)


def draw_legend(c, y):
    """Draw colour legend bar, return new y."""
    box_h = 0.46 * inch
    c.setFillColor(HexColor("#EEF3FA"))
    c.setStrokeColor(HexColor("#BBBBBB"))
    c.setLineWidth(0.5)
    c.rect(LEFT_M, y - box_h, CONTENT_W, box_h, fill=1, stroke=1)

    item_w = CONTENT_W / len(LEGEND)
    lx = LEFT_M + 6
    ly = y - box_h/2
    for bg, acc, label in LEGEND:
        c.setFillColor(bg)
        c.setStrokeColor(acc)
        c.setLineWidth(1.5)
        c.rect(lx, ly - 6, 13, 13, fill=1, stroke=1)
        c.setFont("Helvetica", 9.5)
        c.setFillColor(MED_GRAY)
        c.drawString(lx + 16, ly - 3.5, label)
        lx += item_w
    return y - box_h


def calc_row_height(title, subs):
    title_lines = simpleSplit(title, "Helvetica-Bold", 13, EVENT_COL - 2*PAD - 4)
    content_h = len(title_lines) * 16.0
    for s in subs:
        sl = simpleSplit(s, "Helvetica", 11, EVENT_COL - 2*PAD - 4)
        content_h += len(sl) * 13.5 + 2
    if subs:
        content_h += 4
    return max(content_h + 2*PAD, 40)


def draw_schedule(c, day_data, day_label, date_label, day_color, start_y):
    """Draw day header + all rows. Returns final y."""
    y = start_y

    # Day header
    c.setFillColor(day_color)
    c.rect(LEFT_M, y - DAY_HDR_H, CONTENT_W, DAY_HDR_H, fill=1, stroke=0)
    c.setFillColor(GOLD)
    c.rect(LEFT_M, y,              CONTENT_W, 0.07*inch, fill=1, stroke=0)
    c.rect(LEFT_M, y - DAY_HDR_H, CONTENT_W, 0.07*inch, fill=1, stroke=0)
    c.setFont("Helvetica-Bold", 17)
    c.setFillColor(white)
    c.drawCentredString(W/2, y - 0.20*inch, day_label)
    c.setFont("Helvetica", 12)
    c.setFillColor(LIGHT_GOLD)
    c.drawCentredString(W/2, y - 0.36*inch, date_label)
    y -= DAY_HDR_H + 0.06*inch

    for (t_start, t_end, title, subs, etype) in day_data:
        bg_col, acc_col = TYPE_BG.get(etype, (WARM_WHITE, MED_GRAY))
        row_h = calc_row_height(title, subs)

        # Row background
        c.setFillColor(bg_col)
        c.rect(LEFT_M, y - row_h, CONTENT_W, row_h, fill=1, stroke=0)

        # Accent left bar
        c.setFillColor(acc_col)
        c.rect(LEFT_M, y - row_h, 4, row_h, fill=1, stroke=0)

        # Horizontal separator
        c.setStrokeColor(HexColor("#CCCCCC"))
        c.setLineWidth(0.4)
        c.line(LEFT_M, y, LEFT_M + CONTENT_W, y)

        # Vertical divider
        c.setStrokeColor(HexColor("#AAAAAA"))
        c.setLineWidth(0.4)
        c.line(LEFT_M + TIME_COL, y - row_h, LEFT_M + TIME_COL, y)

        # Time text
        time_cx = LEFT_M + TIME_COL / 2
        row_mid  = y - row_h / 2
        c.setFont("Helvetica-Bold", 12)
        c.setFillColor(acc_col)
        if t_end == "onwards":
            c.drawCentredString(time_cx, row_mid + 4, t_start)
            c.setFont("Helvetica", 9)
            c.setFillColor(MED_GRAY)
            c.drawCentredString(time_cx, row_mid - 9, "onwards")
        else:
            c.drawCentredString(time_cx, row_mid + 7, t_start)
            c.setFont("Helvetica", 9.5)
            c.setFillColor(MED_GRAY)
            c.drawCentredString(time_cx, row_mid - 2, "to")
            c.setFont("Helvetica-Bold", 12)
            c.setFillColor(acc_col)
            c.drawCentredString(time_cx, row_mid - 14, t_end)

        # Event title
        ex = LEFT_M + TIME_COL + PAD + 4
        ey = y - PAD - 2
        c.setFont("Helvetica-Bold", 13)
        c.setFillColor(DARK_BLUE)
        for line in simpleSplit(title, "Helvetica-Bold", 13, EVENT_COL - 2*PAD - 4):
            c.drawString(ex, ey, line)
            ey -= 16.0

        # Sub-lines
        if subs:
            ey -= 4
            for sub in subs:
                c.setFont("Helvetica", 11)
                c.setFillColor(MED_GRAY)
                for sl in simpleSplit(sub, "Helvetica", 11, EVENT_COL - 2*PAD - 4):
                    c.drawString(ex, ey, sl)
                    ey -= 13.5
                ey -= 2

        y -= row_h

    return y


def build():
    c = canvas.Canvas(output_path, pagesize=(W, H))

    # ── PAGE 1: Day 1 ──────────────────────────────────────────────────────────
    draw_chrome(c, 1)

    content_top = H - HEADER_H - 0.15*inch
    y = draw_legend(c, content_top)
    y -= 0.18 * inch

    draw_schedule(c, DAY1,
                  "DAY 1  —  Sunday, 21 June 2026",
                  "Inaugural Day  |  Oral Paper Presentations  |  Quiz  |  Cultural Evening",
                  DAY1_COL, y)

    c.showPage()

    # ── PAGE 2: Day 2 ──────────────────────────────────────────────────────────
    draw_chrome(c, 2)

    y = draw_legend(c, content_top)
    y -= 0.18 * inch

    draw_schedule(c, DAY2,
                  "DAY 2  —  Monday, 22 June 2026",
                  "Poster Presentations  |  Scientific Sessions  |  Quiz Finals  |  Valedictory & Awards",
                  DAY2_COL, y)

    c.save()
    print(f"Schedule PDF (2 pages) created: {output_path}")


if __name__ == "__main__":
    build()
Running Command

cd /home/daytona/workspace/rnt-invite && python create_schedule_v3.py 2>&1

Writing File

~/rnt-invite/create_invite_v2.py

"""
RNT Medical College - MEDINOVA 2026
Conference INVITATION Poster - Pure canvas approach (no blank page)
A2 portrait
"""

from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
from reportlab.lib.colors import HexColor, white
from reportlab.lib.utils import simpleSplit

output_path = "/home/daytona/workspace/rnt-invite/RNT_PGConference_Invite_2026.pdf"

W = 16.54 * inch
H = 23.39 * inch

DARK_BLUE  = HexColor("#0B2C6E")
GOLD       = HexColor("#C9A227")
LIGHT_BLUE = HexColor("#1E5FAD")
PALE_BLUE  = HexColor("#DDE9F7")
WARM_WHITE = HexColor("#FAFAF5")
MED_GRAY   = HexColor("#444444")
LIGHT_GOLD = HexColor("#F5E6B3")
PURPLE     = HexColor("#5B4DB5")
GREEN      = HexColor("#1A7A40")
ORANGE     = HexColor("#C25A12")
RED        = HexColor("#C0392B")


def centered(c, text, cx, y, font, size, color):
    c.setFont(font, size)
    c.setFillColor(color)
    c.drawCentredString(cx, y, text)


def centered_wrapped(c, text, cx, y, max_w, font, size, color, lh=None):
    if lh is None:
        lh = size * 1.35
    c.setFont(font, size)
    c.setFillColor(color)
    lines = simpleSplit(text, font, size, max_w)
    for line in lines:
        c.drawCentredString(cx, y, line)
        y -= lh
    return y


def box(c, x, y, w, h, fill_col, stroke_col=None, lw=0.5, radius=0):
    c.setFillColor(fill_col)
    if stroke_col:
        c.setStrokeColor(stroke_col)
        c.setLineWidth(lw)
        if radius:
            c.roundRect(x, y, w, h, radius, fill=1, stroke=1)
        else:
            c.rect(x, y, w, h, fill=1, stroke=1)
    else:
        if radius:
            c.roundRect(x, y, w, h, radius, fill=1, stroke=0)
        else:
            c.rect(x, y, w, h, fill=1, stroke=0)


def hline(c, x, y, w, color, lw=1.2):
    c.setStrokeColor(color)
    c.setLineWidth(lw)
    c.line(x, y, x+w, y)


def build():
    c = canvas.Canvas(output_path, pagesize=(W, H))

    # ── Background ─────────────────────────────────────────────────────────────
    box(c, 0, 0, W, H, WARM_WHITE)

    # ── TOP HEADER ─────────────────────────────────────────────────────────────
    HEADER_H = 4.0 * inch
    box(c, 0, H - HEADER_H, W, HEADER_H, DARK_BLUE)
    # gold pips
    box(c, 0, H - 0.14*inch, W, 0.14*inch, GOLD)
    box(c, 0, H - HEADER_H,  W, 0.10*inch, GOLD)

    # decorative circles in corners of header
    for cx in [1.15*inch, W - 1.15*inch]:
        cy_circ = H - 1.3*inch
        c.setFillColor(LIGHT_BLUE); c.circle(cx, cy_circ, 1.05*inch, fill=1, stroke=0)
        c.setFillColor(GOLD);       c.circle(cx, cy_circ, 0.72*inch, fill=1, stroke=0)
        c.setFillColor(DARK_BLUE);  c.circle(cx, cy_circ, 0.44*inch, fill=1, stroke=0)

    # Header text
    cy = H - 0.55*inch
    centered(c, "R.N.T. MEDICAL COLLEGE & M.B. HOSPITALS, UDAIPUR",
             W/2, cy, "Helvetica-Bold", 22, white)
    cy -= 0.30*inch
    centered(c, "Department of General Medicine  |  Maharana Pratap University of Health Sciences",
             W/2, cy, "Helvetica", 13.5, LIGHT_GOLD)
    cy -= 0.50*inch
    centered(c, "MEDINOVA 2026", W/2, cy, "Helvetica-Bold", 52, GOLD)
    cy -= 0.50*inch
    centered(c, "National PG Residents' Research Conference",
             W/2, cy, "Helvetica-BoldOblique", 22, PALE_BLUE)
    cy -= 0.36*inch
    centered(c, "Hosted by Department of General Medicine, R.N.T. Medical College, Udaipur",
             W/2, cy, "Helvetica", 13, LIGHT_GOLD)

    # ── FOOTER ─────────────────────────────────────────────────────────────────
    FOOTER_H = 2.0 * inch
    box(c, 0, 0, W, FOOTER_H, DARK_BLUE)
    box(c, 0, FOOTER_H, W, 0.09*inch, GOLD)
    box(c, 0, 0,        W, 0.13*inch, GOLD)

    hline(c, 0.55*inch, FOOTER_H - 0.28*inch, W - 1.1*inch, GOLD, 0.5)

    centered(c, "For Queries & Registration — Contact the Organizing Secretary",
             W/2, FOOTER_H - 0.45*inch, "Helvetica-Bold", 14.5, GOLD)
    centered(c, "Department of General Medicine, R.N.T. Medical College, Udaipur — 313001, Rajasthan",
             W/2, FOOTER_H - 0.70*inch, "Helvetica", 12.5, LIGHT_GOLD)
    centered(c, "Email: medinova2026@rntmc.edu.in     Phone: +91 XXXXX XXXXX",
             W/2, FOOTER_H - 0.92*inch, "Helvetica", 12, LIGHT_GOLD)
    centered(c, "www.rntmc.edu.in",
             W/2, FOOTER_H - 1.14*inch, "Helvetica-Oblique", 11.5, HexColor("#AACCEE"))

    # ── SIDE STRIPS ────────────────────────────────────────────────────────────
    strip_top = H - HEADER_H - 0.09*inch
    strip_bot = FOOTER_H + 0.09*inch
    box(c, 0,            strip_bot, 0.32*inch, strip_top - strip_bot, LIGHT_BLUE)
    box(c, W-0.32*inch,  strip_bot, 0.32*inch, strip_top - strip_bot, LIGHT_BLUE)

    # ── CONTENT AREA ───────────────────────────────────────────────────────────
    LM = 0.62 * inch
    CW = W - 2 * LM
    CX = W / 2

    y = H - HEADER_H - 0.30*inch

    # ── DATE & VENUE BOX ───────────────────────────────────────────────────────
    dbox_h = 1.55 * inch
    box(c, LM, y - dbox_h, CW, dbox_h, LIGHT_GOLD, GOLD, 2, 10)
    # gold left accent bar
    box(c, LM, y - dbox_h, 6, dbox_h, GOLD)

    dc = y - 0.32*inch
    centered(c, "21 & 22 June 2026  (Sunday & Monday)",
             CX, dc, "Helvetica-Bold", 30, DARK_BLUE)
    dc -= 0.36*inch
    centered(c, "Conference Hall, R.N.T. Medical College, Udaipur, Rajasthan",
             CX, dc, "Helvetica", 17, MED_GRAY)
    dc -= 0.30*inch
    centered(c, "Open to PG Residents (MD / MS / DNB) from all Medical Colleges across India",
             CX, dc, "Helvetica-BoldOblique", 14, LIGHT_BLUE)

    y -= dbox_h + 0.32*inch

    # ── SECTION: WHO SHOULD ATTEND ─────────────────────────────────────────────
    hline(c, LM + 0.5*inch, y, CW - inch, GOLD, 1.5)
    y -= 0.10*inch
    centered(c, "WHO SHOULD ATTEND", CX, y, "Helvetica-Bold", 21, DARK_BLUE)
    y -= 0.28*inch
    centered(c, "All PG Residents (MD / MS / DNB) from any recognised Medical College in India",
             CX, y, "Helvetica-Bold", 16, LIGHT_BLUE)
    y -= 0.26*inch
    centered(c, "All Clinical Specialties Welcome  |  No Restriction on Year of Residency",
             CX, y, "Helvetica", 14.5, MED_GRAY)
    y -= 0.24*inch
    hline(c, LM + 0.5*inch, y, CW - inch, GOLD, 1.5)
    y -= 0.28*inch

    # ── SECTION: CONFERENCE HIGHLIGHTS ────────────────────────────────────────
    centered(c, "CONFERENCE HIGHLIGHTS", CX, y, "Helvetica-Bold", 21, DARK_BLUE)
    y -= 0.30*inch

    highlights = [
        (PALE_BLUE,              LIGHT_BLUE, "Oral Paper Presentations",   "All specialties  |  Best paper awards"),
        (HexColor("#E8EFF9"),    LIGHT_BLUE, "Poster Presentations",        "Display & judging  |  Open viewing"),
        (HexColor("#E8F8E8"),    GREEN,      "PG Quiz Competition",          "Teams of 2  |  Exciting prizes"),
        (HexColor("#FFF0E0"),    ORANGE,     "Panel Discussions",            "National faculty panelists"),
        (HexColor("#EDE9F8"),    PURPLE,     "Keynote / Guest Lectures",    "Distinguished national faculty"),
        (HexColor("#FFEAEA"),    RED,        "Best Paper & Poster Awards",  "Gold, Silver & Bronze medals"),
        (HexColor("#FFF8E1"),    GOLD,       "CME Credit Hours",            "Certificate to all delegates"),
        (HexColor("#F3EFD5"),    HexColor("#8B6914"), "Cultural Evening & Gala Dinner", "Day 1 evening"),
    ]

    ncols = 2
    col_w = (CW - 0.18*inch) / ncols
    row_h_hl = 0.74*inch
    nrows = (len(highlights) + 1) // 2

    for i, (bg, acc, hl_title, hl_sub) in enumerate(highlights):
        row_i = i // ncols
        col_i = i % ncols
        bx = LM + col_i * (col_w + 0.18*inch)
        by = y - (row_i + 1) * row_h_hl

        box(c, bx, by, col_w, row_h_hl - 4, bg, HexColor("#CCCCCC"), 0.5, 6)
        # accent left bar
        box(c, bx, by, 5, row_h_hl - 4, acc)
        # title
        c.setFont("Helvetica-Bold", 14)
        c.setFillColor(DARK_BLUE)
        c.drawString(bx + 14, by + row_h_hl - 24, hl_title)
        # sub
        c.setFont("Helvetica", 12)
        c.setFillColor(MED_GRAY)
        c.drawString(bx + 14, by + row_h_hl - 42, hl_sub)

    y -= nrows * row_h_hl + 0.28*inch

    # ── SECTION: ABSTRACT SUBMISSION ──────────────────────────────────────────
    hline(c, LM + 0.5*inch, y, CW - inch, GOLD, 1.5)
    y -= 0.10*inch
    centered(c, "ABSTRACT SUBMISSION", CX, y, "Helvetica-Bold", 21, DARK_BLUE)
    y -= 0.30*inch

    abs_items = [
        (HexColor("#E8EFF9"), LIGHT_BLUE, "Submission Mode", "Online / Email"),
        (LIGHT_GOLD,          GOLD,       "Last Date",       "To Be Announced"),
        (HexColor("#E8F8E8"), GREEN,      "Categories",      "Original Research\nCase Report  |  Review"),
        (HexColor("#EDE9F8"), PURPLE,     "Word Limit",      "250 words (structured)\nWith title & authors"),
    ]

    abs_col_w = (CW - 0.18*inch * 3) / 4
    abs_row_h = 0.88 * inch
    for i, (bg, acc, atitle, asub) in enumerate(abs_items):
        bx = LM + i * (abs_col_w + 0.18*inch * 0.75)
        by = y - abs_row_h
        box(c, bx, by, abs_col_w, abs_row_h, bg, acc, 1.5, 8)
        box(c, bx, by + abs_row_h - 6, abs_col_w, 6, acc)
        c.setFont("Helvetica-Bold", 13)
        c.setFillColor(DARK_BLUE)
        c.drawCentredString(bx + abs_col_w/2, by + abs_row_h - 24, atitle)
        c.setFont("Helvetica", 11.5)
        c.setFillColor(MED_GRAY)
        for j, sl in enumerate(asub.split("\n")):
            c.drawCentredString(bx + abs_col_w/2, by + abs_row_h - 42 - j*15, sl)

    y -= abs_row_h + 0.28*inch

    # ── SECTION: REGISTRATION ──────────────────────────────────────────────────
    hline(c, LM + 0.5*inch, y, CW - inch, GOLD, 1.5)
    y -= 0.10*inch
    centered(c, "REGISTRATION", CX, y, "Helvetica-Bold", 21, DARK_BLUE)
    y -= 0.30*inch

    reg_items = [
        (PALE_BLUE,           LIGHT_BLUE, "Registration Fee",  "To Be Announced"),
        (LIGHT_GOLD,          GOLD,       "Registration Deadline", "To Be Announced"),
        (HexColor("#E8F8E8"), GREEN,      "Accommodation",     "Limited seats\nFirst come first served"),
    ]

    reg_col_w = (CW - 0.36*inch) / 3
    reg_row_h = 0.88 * inch
    for i, (bg, acc, rtitle, rsub) in enumerate(reg_items):
        bx = LM + i * (reg_col_w + 0.18*inch)
        by = y - reg_row_h
        box(c, bx, by, reg_col_w, reg_row_h, bg, acc, 1.5, 8)
        box(c, bx, by + reg_row_h - 6, reg_col_w, 6, acc)
        c.setFont("Helvetica-Bold", 13)
        c.setFillColor(DARK_BLUE)
        c.drawCentredString(bx + reg_col_w/2, by + reg_row_h - 24, rtitle)
        c.setFont("Helvetica", 11.5)
        c.setFillColor(MED_GRAY)
        for j, sl in enumerate(rsub.split("\n")):
            c.drawCentredString(bx + reg_col_w/2, by + reg_row_h - 42 - j*15, sl)

    y -= reg_row_h + 0.28*inch

    # ── ORGANIZING COMMITTEE PLACEHOLDER ──────────────────────────────────────
    hline(c, LM + 0.5*inch, y, CW - inch, GOLD, 1.5)
    y -= 0.10*inch
    centered(c, "ORGANIZING COMMITTEE", CX, y, "Helvetica-Bold", 21, DARK_BLUE)
    y -= 0.28*inch

    oc_box_h = 0.90 * inch
    box(c, LM, y - oc_box_h, CW, oc_box_h, PALE_BLUE, LIGHT_BLUE, 1, 6)
    oy = y - 0.18*inch
    for line in [
        "Chief Patron: Principal & Controller of Examinations, R.N.T. Medical College",
        "Patron: Head of Department, General Medicine, R.N.T. Medical College",
        "Organizing Chairperson: TBA  |  Organizing Secretary: TBA",
        "Co-Organizing Secretary: TBA  |  Scientific Committee: TBA",
    ]:
        centered(c, line, CX, oy, "Helvetica", 12, DARK_BLUE)
        oy -= 0.18*inch

    c.save()
    print(f"Invite PDF created: {output_path}")


if __name__ == "__main__":
    build()
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite_v2.py 2>&1 && python -c " from pypdf import PdfReader r1 = PdfReader('RNT_PGConference_Invite_2026.pdf') r2 = PdfReader('RNT_Schedule_2026.pdf') print(f'Invite: {len(r1.pages)} page(s)') print(f'Schedule: {len(r2.pages)} page(s)') # check text on page 1 of each t1 = r1.pages[0].extract_text() t2 = r2.pages[0].extract_text() print(f'Invite page1 text chars: {len(t1)}') print(f'Schedule page1 text chars: {len(t2)}') print('Invite snippet:', t1[:120].replace(chr(10),' ')) print('Schedule snippet:', t2[:120].replace(chr(10),' ')) " 2>&1

Both PDFs are confirmed to have real text content. Here are your updated files:

Schedule (2 pages, one per day):

RNT Schedule 2026

PDF Document · PDF

Invite (also fixed - pure canvas, no blank):

RNT PGConference Invite 2026

PDF Document · PDF


What changed / why it was blank before:
The old code used ReportLab's Platypus (flowable) system with a custom canvas subclass. The custom canvas was painting the background after all content was laid down, covering everything. The new version draws directly onto the canvas in one pass - background first, then all content on top - so nothing gets hidden.
Schedule poster layout (2 A2 pages):
  • Page 1 - Day 1 (21 June): 13 events from Registration (8am) through Cultural Evening (7:30pm), colour-coded by type
  • Page 2 - Day 2 (22 June): 12 events from Poster Judging (9am) through Closing High Tea (6pm)
  • Each page has: branded header (navy/gold), legend key, colour-coded time rows with accent bars, and footer with venue/contact
Let me know if you'd like any event times, names, or colours adjusted!

Last date of abstract submission 28 april 2026 last date of registration 15 april 2026 and registration fees 2500/-

Reading File
Editing File

~/rnt-invite/create_invite_v2.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite_v2.py'
Editing File

~/rnt-invite/create_invite_v2.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite_v2.py'
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite_v2.py 2>&1

Updated and ready!

RNT PGConference Invite 2026

PDF Document · PDF

The three fields updated on the invite poster:
SectionFieldUpdated Value
Abstract SubmissionLast Date28 April 2026
RegistrationRegistration Deadline15 April 2026
RegistrationRegistration FeeRs. 2,500/-
Let me know if you need any other details added - such as bank account / UPI details for payment, QR code, WhatsApp number, or organizing committee names!

Use the same footer for invite which is used in schedule

Searching Content

"FOOTER" in ~/rnt-invite

Reading File
Editing File

~/rnt-invite/create_invite_v2.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite_v2.py'
Editing File

~/rnt-invite/create_invite_v2.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rnt-invite/create_invite_v2.py'
Running Command

cd /home/daytona/workspace/rnt-invite && python create_invite_v2.py 2>&1

Done! Updated invite is ready:

RNT PGConference Invite 2026

PDF Document · PDF

The footer now matches the schedule exactly - same navy band, same gold top & bottom pips, same 0.28 inch side strips, same font sizes and colours. The three lines in the footer now read:
  1. Venue: Conference Hall, R.N.T. Medical College, Udaipur - 313001, Rajasthan (gold, bold)
  2. Last Date of Registration: 15 April 2026 | Abstract Submission: 28 April 2026 | Registration Fee: Rs. 2,500/- (light gold)
  3. Contact: medinova2026@rntmc.edu.in | Organized by Dept. of General Medicine, R.N.T. Medical College (light blue italic)
This is a shared conversation. Sign in to Orris to start your own chat.