attachment
attachment

I want this sign on paper

analyse_media
Reading File
Running Command

mkdir -p /home/daytona/workspace/drp-letter && ls /home/daytona/workspace/drp-le…

Running Command

python3 -c " from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttf…

Running Command

fc-list | grep -i "noto" | head -30; echo "---"; fc-list | grep -i "lohit" | hea…

Running Command

find /usr/share/fonts /usr/local/share/fonts ~/.fonts 2>/dev/null -name "*.ttf" …

Running Command

pip install --user --quiet babelstone-han 2>/dev/null; # Download Noto Sans Guj…

Running Command

wget -q "https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSansG…

Writing File

~/drp-letter/generate.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from reportlab.lib.pagesizes import A4
from reportlab.lib.units import mm
from reportlab.lib import colors
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
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, TA_RIGHT

# Register Gujarati fonts
FONT_DIR = "/home/daytona/workspace/drp-letter/"
pdfmetrics.registerFont(TTFont("Gujarati", FONT_DIR + "NotoSansGujarati-Regular.ttf"))
pdfmetrics.registerFont(TTFont("Gujarati-Bold", FONT_DIR + "NotoSansGujarati-Bold.ttf"))

# Output path
OUT = "/home/daytona/workspace/drp-letter/DRP_Attendance_Letter.pdf"

doc = SimpleDocTemplate(
    OUT,
    pagesize=A4,
    rightMargin=20*mm,
    leftMargin=20*mm,
    topMargin=15*mm,
    bottomMargin=15*mm,
)

W, H = A4

# --- Styles ---
def guj(size=11, bold=False, align=TA_LEFT, leading=None):
    font = "Gujarati-Bold" if bold else "Gujarati"
    if leading is None:
        leading = size * 1.6
    return ParagraphStyle(
        name=f"guj_{size}_{bold}_{align}",
        fontName=font,
        fontSize=size,
        leading=leading,
        alignment=align,
    )

normal = guj(11)
bold_style = guj(11, bold=True)
center_bold = guj(11, bold=True, align=TA_CENTER)
right_style = guj(11, align=TA_RIGHT)
small = guj(10)
small_bold = guj(10, bold=True)
small_bold_center = guj(10, bold=True, align=TA_CENTER)
small_center = guj(10, align=TA_CENTER)
heading_center = guj(12, bold=True, align=TA_CENTER)

story = []

# --- Top-right header ---
header_lines = [
    "ક્રમાંક/મકમ/હાજરી પત્રક/DRP/૨૦૨૬",
    "જનરલ હોસ્પિટલ પાટણ",
    "તા:- ૧૩/૦૭/૨૦૨૬",
]
for line in header_lines:
    story.append(Paragraph(line, guj(10, align=TA_RIGHT)))
story.append(Spacer(1, 6*mm))

# --- Addressee ---
addressee = [
    "પ્રતિ,",
    "નોડલ ઓફીસરશ્રી,",
    "ડીસ્ટ્રીક્ટ રેસીડેન્સી પ્રોગ્રામ ગુજરાત સરકાર",
    "પી.જી ડાયરેક્ટર, બી.જે મેડીકલ કોલેજ અમદાવાદ.",
]
for line in addressee:
    story.append(Paragraph(line, normal))
story.append(Spacer(1, 5*mm))

# --- Subject ---
story.append(Paragraph(
    "વિષય:- DRP પ્રોગ્રામ અંતર્ગત ફરજ બજાવતા રેસીડન્ટ ડૉક્ટરોની હાજરી બાબત...",
    guj(11, align=TA_CENTER)
))
story.append(Spacer(1, 4*mm))

# --- Salutation + Body ---
story.append(Paragraph("શ્રીમાન", normal))
story.append(Spacer(1, 2*mm))
body_text = (
    "\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0"
    "સવિનય ઉપરોક્ત વિષયે જણાવવાનું કે આત્રેની સંસ્થા ખાતે DRP પ્રોગ્રામ "
    "અંતર્ગત ફરજ બજાવતા રેસીડન્ટ ડૉક્ટરોની હાજરી નીચે મુજબ છે."
)
story.append(Paragraph(body_text, normal))
story.append(Spacer(1, 5*mm))

# --- Month heading ---
story.append(Paragraph("માસ:- જૂન  – ૨૦૨૬", guj(11, bold=True, align=TA_CENTER)))
story.append(Spacer(1, 3*mm))

# --- Table ---
col_widths = [15*mm, 55*mm, 45*mm, 20*mm, 22*mm, 18*mm]

header_row = [
    Paragraph("ક્રમ", small_bold_center),
    Paragraph("નામ", small_bold_center),
    Paragraph("હોદ્દો", small_bold_center),
    Paragraph("કુલ\nદિવસ", small_bold_center),
    Paragraph("ગેર હાજર\nદિવસ", small_bold_center),
    Paragraph("હાજર\nદિવસ", small_bold_center),
]

data = [
    header_row,
    [
        Paragraph("૧", small_center),
        Paragraph("Dr Ayushi Agrawal", small),
        Paragraph("MD Medicine", small),
        Paragraph("૩૦", small_center),
        Paragraph("૦", small_center),
        Paragraph("૧૮", small_center),
    ],
    [
        Paragraph("૨", small_center),
        Paragraph("Dr Tarunkumar Shah", small),
        Paragraph("MD Medicine", small),
        Paragraph("૩૦", small_center),
        Paragraph("૦", small_center),
        Paragraph("૧૫", small_center),
    ],
    [
        Paragraph("૩", small_center),
        Paragraph("Dr Hitesh Vaghela", small),
        Paragraph("General Surgery", small),
        Paragraph("૩૦", small_center),
        Paragraph("૦", small_center),
        Paragraph("૧૫", small_center),
    ],
    [
        Paragraph("૪", small_center),
        Paragraph("Dr Nachiket Sakhiya", small),
        Paragraph("General Surgery", small),
        Paragraph("૩૦", small_center),
        Paragraph("૦", small_center),
        Paragraph("૧૫", small_center),
    ],
]

table = Table(data, colWidths=col_widths, repeatRows=1)
table.setStyle(TableStyle([
    ("GRID",       (0, 0), (-1, -1), 0.5, colors.black),
    ("BACKGROUND", (0, 0), (-1,  0), colors.lightgrey),
    ("VALIGN",     (0, 0), (-1, -1), "MIDDLE"),
    ("ROWBACKGROUND", (0, 1), (-1, -1), [colors.white, colors.whitesmoke]),
    ("TOPPADDING",    (0, 0), (-1, -1), 3),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
    ("LEFTPADDING",   (0, 0), (-1, -1), 4),
    ("RIGHTPADDING",  (0, 0), (-1, -1), 4),
]))
story.append(table)
story.append(Spacer(1, 12*mm))

# --- Signature (right-aligned) ---
sig_lines = [
    "મુખ્ય જિલ્લા તબીબી અધિકારી",
    "સહ સીવીલ સર્જન",
    "જનરલ હોસ્પિટલ પાટણ",
]
for line in sig_lines:
    story.append(Paragraph(line, guj(11, align=TA_RIGHT)))
story.append(Spacer(1, 10*mm))

# --- Copy section ---
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.black))
story.append(Spacer(1, 3*mm))

# Underlined "નકલ સવિનય રવાના:-"
copy_heading1 = Paragraph(
    '<u>નકલ સવિનય રવાના:-</u>',
    guj(11, bold=True)
)
story.append(copy_heading1)
story.append(Paragraph(
    "\u2714  ડીનશ્રી એન.એલ મ્યુ.કોલેજ અમદાવાદ તરફ જાણ સારું.",
    normal
))
story.append(Spacer(1, 3*mm))

copy_heading2 = Paragraph(
    '<u>નકલ રવાના :-</u>',
    guj(11, bold=True)
)
story.append(copy_heading2)
story.append(Paragraph(
    "○  નિવાસી તબીબી અધિકારીશ્રી, જનરલ હોસ્પિટલ પાટણ તરફ જાણ સારું.",
    normal
))
story.append(Paragraph(
    "○  ડીસ્ટ્રીક્ટ રેસીડેન્ટ પ્રોગ્રામ, જનરલ હોસ્પિટલ પાટણ તરફ જાણ સારું.",
    normal
))

# Build
doc.build(story)
print(f"PDF created: {OUT}")
Running Command

cd /home/daytona/workspace/drp-letter && python3 generate.py 2>&1

The PDF was generated successfully. Here is your print-ready document:

DRP Attendance Letter

PDF Document · PDF

The PDF contains all the content from the photo, faithfully reproduced in Gujarati and English:
  • Header - Reference number, General Hospital Patan, date 13/07/2026
  • Addressee - Nodal Officer / DRP Gujarat Sarkar / B.J. Medical College Ahmedabad
  • Subject line and body paragraph
  • Attendance table for June 2026 with all 4 doctors (Dr Ayushi Agrawal, Dr Tarunkumar Shah, Dr Hitesh Vaghela, Dr Nachiket Sakhiya) and their attendance figures
  • Signature block - Mukhya Jilla Tabeebi Adhikari, Sah Civil Surgeon, General Hospital Patan
  • Copy distribution section with both recipients
It is A4 size and ready to print directly.
This is a shared conversation. Sign in to Orris to start your own chat.