~/diet-chart-bengali/generate_diet_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus import PageBreak
OUTPUT = "/home/daytona/workspace/diet-chart-bengali/Bengali_Diet_Chart.pdf"
# ββ Colour palette ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
GREEN_DARK = colors.HexColor("#1a6b3c")
GREEN_MED = colors.HexColor("#2d9152")
GREEN_LIGHT = colors.HexColor("#e8f5ee")
GREEN_PALE = colors.HexColor("#f4fbf7")
ORANGE = colors.HexColor("#e07b1a")
ORANGE_PALE = colors.HexColor("#fff3e0")
RED_PALE = colors.HexColor("#fff0f0")
RED_DARK = colors.HexColor("#c0392b")
GOLD = colors.HexColor("#f0c040")
GREY_LIGHT = colors.HexColor("#f5f5f5")
GREY_MED = colors.HexColor("#cccccc")
WHITE = colors.white
DARK_TEXT = colors.HexColor("#212121")
BLUE_PALE = colors.HexColor("#e8f0fe")
BLUE_DARK = colors.HexColor("#1a4a8a")
# ββ Document setup ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=15*mm, rightMargin=15*mm,
topMargin=12*mm, bottomMargin=12*mm,
)
W, H = A4
# ββ Styles βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
sTitle = S("sTitle",
fontName="Helvetica-Bold", fontSize=18, textColor=WHITE,
alignment=TA_CENTER, leading=24, spaceAfter=2)
sSubTitle = S("sSubTitle",
fontName="Helvetica", fontSize=10, textColor=WHITE,
alignment=TA_CENTER, leading=14)
sPatientInfo = S("sPatientInfo",
fontName="Helvetica", fontSize=9, textColor=DARK_TEXT,
alignment=TA_LEFT, leading=13)
sSectionHead = S("sSectionHead",
fontName="Helvetica-Bold", fontSize=11, textColor=WHITE,
alignment=TA_LEFT, leading=16, leftIndent=4)
sMealHead = S("sMealHead",
fontName="Helvetica-Bold", fontSize=10, textColor=GREEN_DARK,
leading=14, spaceAfter=2)
sNote = S("sNote",
fontName="Helvetica-Oblique", fontSize=8, textColor=colors.HexColor("#555555"),
leading=11, leftIndent=4)
sTableHead = S("sTableHead",
fontName="Helvetica-Bold", fontSize=8.5, textColor=WHITE,
alignment=TA_CENTER, leading=11)
sTableCell = S("sTableCell",
fontName="Helvetica", fontSize=8.5, textColor=DARK_TEXT,
leading=12, leftIndent=2)
sTableCellC = S("sTableCellC",
fontName="Helvetica", fontSize=8.5, textColor=DARK_TEXT,
alignment=TA_CENTER, leading=12)
sFooter = S("sFooter",
fontName="Helvetica-Oblique", fontSize=7.5, textColor=colors.HexColor("#777777"),
alignment=TA_CENTER, leading=10)
sBullet = S("sBullet",
fontName="Helvetica", fontSize=8.5, textColor=DARK_TEXT,
leading=12, leftIndent=8, firstLineIndent=-6)
sWarning = S("sWarning",
fontName="Helvetica-Bold", fontSize=8.5, textColor=RED_DARK,
leading=12, leftIndent=4)
sTip = S("sTip",
fontName="Helvetica-Oblique", fontSize=8, textColor=BLUE_DARK,
leading=11, leftIndent=6)
story = []
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# HEADER BANNER
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
header_data = [[
Paragraph("PERSONALISED DIET CHART", sTitle),
]]
header_table = Table(header_data, colWidths=[180*mm])
header_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREEN_DARK),
("ROWPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [6]),
("BOX", (0,0), (-1,-1), 0, GREEN_DARK),
]))
story.append(header_table)
story.append(Spacer(1, 2*mm))
sub_data = [[
Paragraph("Bengali Diet Plan | Murshidabad Region", sSubTitle),
]]
sub_table = Table(sub_data, colWidths=[180*mm])
sub_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREEN_MED),
("ROWPADDING", (0,0), (-1,-1), 5),
("BOX", (0,0), (-1,-1), 0, GREEN_MED),
]))
story.append(sub_table)
story.append(Spacer(1, 3*mm))
# Patient info box
patient_data = [
[
Paragraph("<b>Patient Weight:</b> 85 kg", sPatientInfo),
Paragraph("<b>Conditions:</b> Type 2 Diabetes | Hypertension | High Uric Acid | Fatty Liver | Constipation", sPatientInfo),
Paragraph("<b>Date:</b> June 2026", sPatientInfo),
]
]
pt = Table(patient_data, colWidths=[38*mm, 110*mm, 32*mm])
pt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), BLUE_PALE),
("BOX", (0,0), (-1,-1), 0.8, BLUE_DARK),
("ROWPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(pt)
story.append(Spacer(1, 4*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# KEY RULES BANNER
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def section_header(text, color=GREEN_DARK):
d = [[Paragraph(text, sSectionHead)]]
t = Table(d, colWidths=[180*mm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("ROWPADDING", (0,0), (-1,-1), 5),
("BOX", (0,0), (-1,-1), 0, color),
]))
return t
story.append(section_header(" CORE DIETARY RULES"))
story.append(Spacer(1, 2*mm))
rules = [
("Type 2 Diabetes", "Low GI foods | No refined sugar | Small frequent meals | No white rice in large qty"),
("Hypertension", "Low sodium (<2g/day) | No pickle/papad | No extra salt at table"),
("High Uric Acid", "Avoid hilsa/prawn/shutki/red meat | Use moong dal | Drink 8-10 glasses water daily"),
("Fatty Liver (NAFLD)", "No fried foods | No maida | Max 3 tsp oil/day | No alcohol | No excess sugar"),
("Constipation", "High fiber diet | Seasonal vegetables | Isabgol at bedtime | 2-2.5L water/day"),
("Weight Goal", "Target -3 to -5 kg in 3 months | ~1600-1800 kcal/day | 30-min walk daily"),
]
rules_data = [[
Paragraph("<b>" + r[0] + "</b>", sTableCell),
Paragraph(r[1], sTableCell)
] for r in rules]
rules_table = Table(rules_data, colWidths=[42*mm, 138*mm])
rules_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,-1), GREEN_LIGHT),
("BACKGROUND", (1,0), (1,-1), WHITE),
("ROWBACKGROUNDS", (0,0), (-1,-1), [GREEN_PALE, WHITE]),
("BOX", (0,0), (-1,-1), 0.5, GREEN_MED),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(rules_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# MEAL PLAN TABLE (main visual element)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_header(" DAILY MEAL PLAN - TIME SCHEDULE"))
story.append(Spacer(1, 2*mm))
meal_hdr = [
Paragraph("Meal", sTableHead),
Paragraph("Time", sTableHead),
Paragraph("Food Items (Bengali / Murshidabad)", sTableHead),
Paragraph("Quantity", sTableHead),
Paragraph("Key Benefit", sTableHead),
]
def mp(text): return Paragraph(text, sTableCell)
def mc(text): return Paragraph(text, sTableCellC)
meal_rows = [
# Early morning
[mc("Early Morning\nBhor Uthey"), mc("6:00 - 6:30\nAM"),
mp("Lukewarm water with lemon (no sugar)\n+ Methi (fenugreek) seeds soaked overnight"),
mc("1 glass\n1 tsp methi"),
mp("Flushes uric acid, lowers fasting sugar")],
# Breakfast A
[mc("Breakfast\nOption A\n(Mon/Wed/Fri)"), mc("7:30 - 8:30\nAM"),
mp("Lal chaler khichdi (red rice + moong dal)\nStir-fried seasonal saag (notey / lal / pui)\nSliced cucumber"),
mc("150g cooked\n1 katori\n4-5 slices"),
mp("Low GI, high fiber, low purine")],
# Breakfast B
[mc("Breakfast\nOption B\n(Tue/Thu)"), mc("7:30 - 8:30\nAM"),
mp("Oats cooked in water (pinch jeera, no sugar)\n1 boiled egg white only\nSmall guava (peyara)"),
mc("1 bowl\n1 white\n1 small (80g)"),
mp("Fiber-rich; egg white = protein without fat")],
# Breakfast C
[mc("Breakfast\nOption C\n(Sat/Sun)"), mc("7:30 - 8:30\nAM"),
mp("2 thin whole wheat rotis (no ghee)\nUchhe bhaja (bitter gourd, minimal oil, dry)\nHomemade low-fat doi (curd)"),
mc("2 small\nhalf katori\n1 katori"),
mp("Uchhe = best natural blood sugar control")],
# Mid-morning
[mc("Mid-Morning\nTiffin"), mc("10:30 - 11:00\nAM"),
mp("1 seasonal fruit: Peyara / Papaya / Amloki / Jamun\nOR: Roasted Bengal gram (no salt)\nPlain water"),
mc("~100g fruit\nOR 30g chana\n1-2 glasses"),
mp("Fiber + vitamins; uric acid clearance via water")],
# Lunch
[mc("Lunch\nDupurer\nBhojan"), mc("1:00 - 2:00\nPM"),
mp("Lal chaal (red/parboiled rice) bhat\nMoong dal (thin, light)\nRui / Katla macher jhol (light)\n2 vegetable dishes (see list below)\nRaw salad (kakdi, tomato)"),
mc("150g cooked\n1 katori\n1 medium piece\n1 katori each\n1 small plate"),
mp("Main meal; balanced protein + carbs + fiber")],
# Afternoon tiffin
[mc("Afternoon\nTiffin\nBikeler Khabar"), mc("4:00 - 4:30\nPM"),
mp("Green tea (no sugar)\n+ Makhana dry roasted\nOR 4-5 whole wheat crackers\nOR roasted chana (plain)"),
mc("1 cup\n15-20 pieces\nOR 4-5\nOR 1 handful"),
mp("Green tea reduces liver fat; low-cal snack")],
# Dinner
[mc("Dinner\nRater Bhojan"), mc("7:30 - 8:30\nPM"),
mp("2 whole wheat rotis (thin, no ghee)\nMoong dal (light)\n1-2 vegetable dishes (from list)\nHomemade doi (curd)\nOR: Clear vegetable soup (lau / moong)"),
mc("2 small\n1 katori\n1 katori each\n1 katori\n1 bowl"),
mp("Lighter than lunch; finish by 8:30 PM")],
# Supper / bedtime
[mc("Supper /\nBedtime"), mc("10:00 - 10:30\nPM"),
mp("Isabgol (psyllium husk) in warm water -- DAILY\nOR: Warm low-fat milk (no sugar)\nOR: 1-2 walnut halves (akhrot)"),
mc("1 tsp isabgol\nOR 150ml milk\nOR 1-2 pieces"),
mp("Isabgol = best remedy for constipation; walnut = liver support")],
]
meal_table_data = [meal_hdr] + meal_rows
col_w = [28*mm, 20*mm, 73*mm, 28*mm, 31*mm]
meal_table = Table(meal_table_data, colWidths=col_w, repeatRows=1)
row_bg = []
for i in range(1, len(meal_table_data)):
bg = GREEN_PALE if i % 2 == 0 else WHITE
row_bg.append(("BACKGROUND", (0, i), (-1, i), bg))
meal_table.setStyle(TableStyle([
# Header row
("BACKGROUND", (0,0), (-1,0), GREEN_DARK),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("ROWPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
("BOX", (0,0), (-1,-1), 0.8, GREEN_DARK),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
# Alternating row backgrounds
*row_bg,
# Meal name column styling
("BACKGROUND", (0,1), (0,-1), GREEN_LIGHT),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,1), (0,-1), 8),
("TEXTCOLOR", (0,1), (0,-1), GREEN_DARK),
("ALIGN", (0,0), (1,-1), "CENTER"),
("ALIGN", (3,0), (3,-1), "CENTER"),
]))
story.append(meal_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# VEGETABLES LIST
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(KeepTogether([
section_header(" RECOMMENDED VEGETABLES (MURSHIDABAD - SEASONAL)"),
Spacer(1, 2*mm),
]))
vegs = [
("Uchhe (Bitter Gourd)", "Best anti-diabetic vegetable - controls blood sugar"),
("Lau (Bottle Gourd)", "Excellent for BP, liver health, and weight loss"),
("Potol (Pointed Gourd)", "Low calorie, easy to digest, available year-round"),
("Jhinge (Ridge Gourd)", "High fiber, low GI, good for constipation"),
("Dharosh (Okra / Bhindi)", "Excellent fiber - controls sugar & relieves constipation"),
("Begun (Brinjal/Eggplant)", "Baked or bhate (steamed) ONLY - not fried"),
("Kumro (Pumpkin)", "Small quantity only - slightly higher GI"),
("Notey / Lal / Pui Saag", "High fiber leafy greens - antioxidants, iron"),
("Pata Kopi (Cabbage)", "High fiber, anti-inflammatory, readily available"),
("Kakrol (Spine Gourd)", "Very low calorie, available locally in Murshidabad"),
("Sim / Sheem (Hyacinth Bean)", "Protein + fiber - good substitute when dal is limited"),
]
veg_data = [[Paragraph("<b>Vegetable</b>", sTableHead), Paragraph("<b>Why It Helps</b>", sTableHead)]]
for v, d in vegs:
veg_data.append([Paragraph(v, sTableCell), Paragraph(d, sTableCell)])
veg_table = Table(veg_data, colWidths=[55*mm, 125*mm])
veg_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GREEN_MED),
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREEN_PALE]),
("BOX", (0,0), (-1,-1), 0.5, GREEN_MED),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(veg_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# FOODS TO AVOID
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(KeepTogether([
section_header(" FOODS TO STRICTLY AVOID", color=RED_DARK),
Spacer(1, 2*mm),
]))
avoid_data = [
[Paragraph("<b>Category</b>", sTableHead), Paragraph("<b>Foods to Avoid - Why</b>", sTableHead)],
[Paragraph("For Diabetes", sTableCell),
Paragraph("White rice (large qty) | Maida/luchi/kochuri | Sugar/mishti | Rasgolla/sandesh | Mango juice | Cold drinks | Sweetened tea", sTableCell)],
[Paragraph("For Hypertension", sTableCell),
Paragraph("Extra salt | Achar (pickle) | Papad | Shutki (dried fish - very high sodium) | Salted namkeen/chips | Packaged/processed foods", sTableCell)],
[Paragraph("For High Uric Acid", sTableCell),
Paragraph("Ilish/Hilsa | Chingri (prawns) | Shutki (dried fish) | Mutton/beef/pork | Organ meats (liver/kidney) | Masur dal (excess) | Rajma | Alcohol", sTableCell)],
[Paragraph("For Fatty Liver", sTableCell),
Paragraph("All fried foods (deep-fried fish, bhaja) | Oil-heavy curries | Coconut milk | Maida | Excess sugar | Trans fats | Alcohol (strictly zero)", sTableCell)],
[Paragraph("For Constipation", sTableCell),
Paragraph("Refined flour (maida) | White bread | Excess non-veg | Low water intake | Skipping meals | Sedentary lifestyle", sTableCell)],
]
avoid_table = Table(avoid_data, colWidths=[38*mm, 142*mm])
avoid_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED_DARK),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [RED_PALE, WHITE]),
("BOX", (0,0), (-1,-1), 0.5, RED_DARK),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
("BACKGROUND", (0,1), (0,-1), colors.HexColor("#fce4e4")),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("TEXTCOLOR", (0,1), (0,-1), RED_DARK),
]))
story.append(avoid_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SPECIAL LOCAL SUPERFOODS
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(KeepTogether([
section_header(" LOCAL MURSHIDABAD SUPERFOODS - USE DAILY"),
Spacer(1, 2*mm),
]))
sf_data = [
[Paragraph("<b>Food</b>", sTableHead), Paragraph("<b>Benefit</b>", sTableHead),
Paragraph("<b>How to Use</b>", sTableHead)],
[mp("Lal Chaal (Red/Brown Rice)"), mp("Lower GI than white rice, more fiber"), mp("Use as staple instead of white rice")],
[mp("Amloki (Amla / Indian Gooseberry)"), mp("Liver protection, vitamin C, uric acid clearance"), mp("Raw, or juice with water, daily")],
[mp("Bel (Wood Apple)"), mp("Natural laxative - best for constipation"), mp("Bel sherbet (no sugar) in afternoon")],
[mp("Peyara (Guava)"), mp("Low GI, high fiber, vitamin C"), mp("Mid-morning or afternoon snack")],
[mp("Moong Dal (Yellow Mung)"), mp("Low purine, high protein, liver-friendly"), mp("At lunch or dinner as thin dal")],
[mp("Doi (Homemade Curd / Yogurt)"), mp("Probiotic - gut health, liver support"), mp("With lunch or evening meal")],
[mp("Isabgol (Psyllium Husk)"), mp("Best fiber supplement for constipation"), mp("1 tsp in warm water before bed - DAILY")],
[mp("Haldi (Turmeric)"), mp("Liver-protective anti-inflammatory"), mp("Add to all dal and sabzi cooking")],
[mp("Ada (Ginger)"), mp("Anti-inflammatory, aids digestion"), mp("Add to tea (no sugar) or cooking")],
]
sf_table = Table(sf_data, colWidths=[48*mm, 74*mm, 58*mm])
sf_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), GREEN_DARK),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("ROWBACKGROUNDS", (0,1), (-1,-1), [GREEN_PALE, WHITE]),
("BOX", (0,0), (-1,-1), 0.5, GREEN_MED),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 4),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(sf_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# COOKING GUIDELINES & WATER
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(KeepTogether([
section_header(" COOKING GUIDELINES & FLUIDS"),
Spacer(1, 2*mm),
]))
cg_data = [
["Oil", "Mustard oil (sarshon tel) only. MAX 3 teaspoons (15 ml) per day total across ALL cooking."],
["Salt", "Minimal in cooking. NO extra salt at the table. No papad, pickle, or packaged snacks."],
["Cooking method", "Bhate (steam), boil, light stir-fry. No deep frying, no heavy gravies."],
["Water", "8-10 glasses of plain water daily (2-2.5 litres). Helps flush uric acid and supports liver."],
["Tea/Coffee", "Max 1-2 cups/day. NO sugar. Green tea preferred (1-2 cups/day reduces liver fat)."],
["Coconut water", "1 small glass occasionally (monitor if on potassium-restricting BP medications)."],
["Avoid", "Fruit juices, cold drinks, packaged beverages, sweetened lassi, sweetened chai."],
]
cg_table = Table(
[[Paragraph("<b>"+r[0]+"</b>", sTableCell), Paragraph(r[1], sTableCell)] for r in cg_data],
colWidths=[36*mm, 144*mm]
)
cg_table.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [GREY_LIGHT, WHITE]),
("BOX", (0,0), (-1,-1), 0.5, GREY_MED),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(cg_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# IMPORTANT CLINICAL NOTES
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(KeepTogether([
section_header(" IMPORTANT NOTES FOR PATIENT & FAMILY", color=BLUE_DARK),
Spacer(1, 2*mm),
]))
notes = [
"All prescribed medications must be continued as directed by your doctor. This diet chart is SUPPORTIVE - not a replacement for medication.",
"URIC ACID: Avoid ilish (hilsa), chingri (prawn), shutki (dried fish), mutton, and organ meats completely. Rui or Katla fish is allowed - 1 medium piece/day maximum.",
"FATTY LIVER: Oil limit is STRICT - 3 teaspoons total per day. Turmeric and ginger in daily cooking helps liver healing. Repeat USG abdomen + LFT every 6 months.",
"CONSTIPATION: Take 1 teaspoon isabgol in warm water every night before bed. Eat fiber-rich vegetables at every meal. Do not skip meals - fasting worsens constipation AND raises uric acid.",
"BLOOD SUGAR MONITORING: Check fasting + 2-hour post-meal readings weekly. Report persistent high readings to your doctor.",
"EXERCISE: 30-minute brisk walk every day (morning or evening). Exercise is as important as diet for ALL your conditions.",
"MEAL TIMING: Never skip meals. Do not gap meals by more than 4-5 hours. Finish dinner by 8:30 PM - late eating worsens fatty liver and blood sugar control.",
"WEIGHT GOAL: Losing just 3-5 kg over 3 months will significantly improve blood sugar, blood pressure, uric acid levels AND reduce liver fat.",
]
notes_data = [[Paragraph(str(i+1)+". " + n, sBullet)] for i, n in enumerate(notes)]
notes_table = Table(notes_data, colWidths=[180*mm])
notes_table.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [BLUE_PALE, WHITE]),
("BOX", (0,0), (-1,-1), 0.5, BLUE_DARK),
("INNERGRID", (0,0), (-1,-1), 0.3, GREY_MED),
("ROWPADDING", (0,0), (-1,-1), 5),
]))
story.append(notes_table)
story.append(Spacer(1, 5*mm))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# FOOTER
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(HRFlowable(width="100%", thickness=1, color=GREEN_MED))
story.append(Spacer(1, 2*mm))
story.append(Paragraph(
"This diet chart is prepared based on standard clinical dietetics guidelines for multi-morbidity management, "
"adapted for Bengali / Murshidabad food culture and seasonal availability. "
"Please consult your treating physician before making any changes to your medications or diet.",
sFooter
))
story.append(Spacer(1, 1*mm))
story.append(Paragraph(
"Prepared by: Clinical Dietician | Date: June 2026 | For: Murshidabad Region Patient",
sFooter
))
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# BUILD
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
doc.build(story)
print(f"PDF saved to: {OUTPUT}")