Medicine all use simple
Yes all
| Rule | Why |
|---|---|
| Always read the label | Doses matter a lot |
| Tell your doctor ALL medicines you take | Some medicines clash badly |
| Antibiotics ≠ virus treatment | They only work on bacteria |
| Never share prescription medicines | They are prescribed for your specific problem |
| Don't stop suddenly without asking | Some medicines (steroids, antidepressants, blood pressure pills) need to be tapered |
निम्बू वाली बनाकर, short में PDF बनाकर दो, अच्छे से। Disease, medication use, side effect, all important common disease जो रही है use आजकल medicine, common medicine. इसी-
mkdir -p /home/daytona/workspace/medicine-pdf && ls /home/daytona/workspace/medi…
~/medicine-pdf/create_medicine_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
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
from reportlab.platypus import PageBreak
# ── Lemon color palette ──────────────────────────────────────────────────────
LEMON = colors.HexColor("#F5E642") # bright lemon yellow
LEMON_LIGHT = colors.HexColor("#FFFDE7") # pale lemon background
LEMON_MID = colors.HexColor("#FFF176") # mid lemon
LEMON_DARK = colors.HexColor("#F9A825") # dark amber / lemon skin
TEXT_DARK = colors.HexColor("#212121") # near-black text
ACCENT_GREEN = colors.HexColor("#33691E") # leaf green for headings
WHITE = colors.white
RED_SOFT = colors.HexColor("#C62828") # soft red for side effects
BLUE_SOFT = colors.HexColor("#1565C0") # for medicine names
OUTPUT = "/home/daytona/workspace/medicine-pdf/Common_Medicines_Guide.pdf"
# ── Styles ───────────────────────────────────────────────────────────────────
def make_styles():
base = getSampleStyleSheet()
title_style = ParagraphStyle(
"Title2",
parent=base["Title"],
fontSize=26,
textColor=ACCENT_GREEN,
alignment=TA_CENTER,
spaceAfter=4,
fontName="Helvetica-Bold",
)
subtitle_style = ParagraphStyle(
"Subtitle",
parent=base["Normal"],
fontSize=11,
textColor=LEMON_DARK,
alignment=TA_CENTER,
spaceAfter=2,
fontName="Helvetica-Oblique",
)
section_style = ParagraphStyle(
"Section",
parent=base["Heading1"],
fontSize=13,
textColor=WHITE,
backColor=ACCENT_GREEN,
spaceBefore=10,
spaceAfter=4,
leftIndent=8,
fontName="Helvetica-Bold",
borderPad=4,
)
disease_style = ParagraphStyle(
"Disease",
parent=base["Normal"],
fontSize=11,
textColor=ACCENT_GREEN,
fontName="Helvetica-Bold",
spaceBefore=4,
spaceAfter=2,
)
body_style = ParagraphStyle(
"Body2",
parent=base["Normal"],
fontSize=9,
textColor=TEXT_DARK,
fontName="Helvetica",
spaceAfter=2,
leftIndent=6,
)
note_style = ParagraphStyle(
"Note",
parent=base["Normal"],
fontSize=8,
textColor=LEMON_DARK,
fontName="Helvetica-Oblique",
spaceAfter=2,
leftIndent=6,
)
footer_style = ParagraphStyle(
"Footer",
parent=base["Normal"],
fontSize=8,
textColor=colors.grey,
alignment=TA_CENTER,
)
return {
"title": title_style,
"subtitle": subtitle_style,
"section": section_style,
"disease": disease_style,
"body": body_style,
"note": note_style,
"footer": footer_style,
}
# ── Data ─────────────────────────────────────────────────────────────────────
DISEASES = [
{
"section": "🤒 बुखार, दर्द & सूजन (Fever, Pain & Inflammation)",
"entries": [
{
"disease": "बुखार / सिरदर्द / हल्का दर्द (Fever / Headache / Mild Pain)",
"medicine": "Paracetamol (Crocin, Calpol, Dolo 650)",
"use": "बुखार कम करे, दर्द घटाए",
"dose": "500–1000 mg हर 6 घंटे में (max 4g/day)",
"side_effects": "अधिक मात्रा में Liver damage; सामान्य dose में बहुत safe",
"tip": "खाली पेट ले सकते हैं",
},
{
"disease": "दर्द + सूजन (Pain + Swelling / Inflammation)",
"medicine": "Ibuprofen (Brufen, Combiflam)",
"use": "दर्द, बुखार, सूजन तीनों कम करे",
"dose": "400 mg हर 8 घंटे (खाने के साथ)",
"side_effects": "पेट दर्द, Acidity, Kidney पर असर (लंबे समय)",
"tip": "Ulcer हो तो avoid करें",
},
{
"disease": "जोड़ों का दर्द / गठिया (Joint Pain / Arthritis)",
"medicine": "Diclofenac (Voveran), Naproxen",
"use": "सूजन और दर्द घटाए",
"dose": "50 mg दिन में 2-3 बार",
"side_effects": "पेट में जलन, BP बढ़ना, Kidney",
"tip": "PPI (Omeprazole) साथ लें",
},
],
},
{
"section": "🤧 सर्दी, खांसी & एलर्जी (Cold, Cough & Allergy)",
"entries": [
{
"disease": "एलर्जी / बहती नाक / खुजली (Allergy / Runny Nose / Itching)",
"medicine": "Cetirizine (Zyrtec, Alerid), Loratadine",
"use": "Histamine block करे – एलर्जी रोके",
"dose": "10 mg रात को एक बार",
"side_effects": "नींद आना (Cetirizine में ज़्यादा), मुँह सूखना",
"tip": "रात को लेना बेहतर",
},
{
"disease": "बंद नाक (Blocked Nose)",
"medicine": "Xylometazoline Nasal Spray (Otrivin)",
"use": "नाक की सूजी नसें सिकोड़े",
"dose": "1-2 drops/spray, दिन में 2-3 बार",
"side_effects": "3-5 दिन से ज़्यादा use = और बंद नाक (Rebound)",
"tip": "Max 5 दिन ही use करें",
},
{
"disease": "सूखी खांसी (Dry Cough)",
"medicine": "Dextromethorphan (Benadryl Cough), Codeine",
"use": "खांसी का reflex दबाए",
"dose": "Syrup – label देखें",
"side_effects": "नींद, चक्कर, कब्ज़",
"tip": "Productive cough में use न करें",
},
{
"disease": "बलगम वाली खांसी (Wet Cough)",
"medicine": "Ambroxol (Mucinac), Bromhexine",
"use": "बलगम पतला करे, निकलने में मदद",
"dose": "30 mg दिन में 3 बार",
"side_effects": "मतली, पेट में हल्की तकलीफ",
"tip": "ढेर सारा पानी पिएं",
},
],
},
{
"section": "🫁 दमा & सांस (Asthma & Breathing)",
"entries": [
{
"disease": "अस्थमा अटैक / घबराहट वाली सांस (Asthma Attack)",
"medicine": "Salbutamol Inhaler (Asthalin, Ventolin) – BLUE",
"use": "Airways खोले – तुरंत राहत",
"dose": "1-2 puffs जब ज़रूरत हो",
"side_effects": "हाथ काँपना, दिल तेज़ धड़कना",
"tip": "Rescue inhaler – रोज़ नहीं, ज़रूरत पर",
},
{
"disease": "दमे की रोकथाम (Asthma Prevention)",
"medicine": "Budesonide Inhaler (Budecort) – BROWN/ORANGE",
"use": "Airways की सूजन रोज़ कम करे",
"dose": "1-2 puffs सुबह-शाम रोज़",
"side_effects": "मुँह में Fungus (Candida) – use के बाद कुल्ला करें",
"tip": "Preventer है – बंद न करें जब ठीक लगे",
},
],
},
{
"section": "❤️ BP, दिल & Cholesterol",
"entries": [
{
"disease": "High Blood Pressure (उच्च रक्तचाप)",
"medicine": "Amlodipine (Amlod), Telmisartan, Ramipril",
"use": "Blood vessels को relax करे, BP कम करे",
"dose": "Doctor के अनुसार – रोज़ एक बार",
"side_effects": "Amlodipine: पैरों में सूजन | Ramipril: सूखी खांसी",
"tip": "कभी अचानक बंद न करें",
},
{
"disease": "High Cholesterol (LDL बढ़ा)",
"medicine": "Atorvastatin (Lipitor, Atorva), Rosuvastatin",
"use": "Liver से bad cholesterol (LDL) कम करे",
"dose": "10-40 mg रात को",
"side_effects": "Muscle pain/weakness, Liver enzyme बढ़ना",
"tip": "रात को लें; Grapefruit juice avoid",
},
{
"disease": "Heart Attack Prevention / Blood Clot",
"medicine": "Aspirin 75 mg (Ecosprin)",
"use": "Blood thinning – clot नहीं बनने देता",
"dose": "75 mg रोज़ एक बार (खाने के साथ)",
"side_effects": "Stomach bleeding, Acidity",
"tip": "PPI साथ लें",
},
],
},
{
"section": "🩸 Diabetes (मधुमेह)",
"entries": [
{
"disease": "Type 2 Diabetes",
"medicine": "Metformin (Glucophage, Glycomet)",
"use": "Liver का sugar कम करे, Insulin sensitivity बढ़ाए",
"dose": "500-1000 mg खाने के साथ",
"side_effects": "पेट फूलना, दस्त (शुरुआत में), B12 कमी",
"tip": "धीरे-धीरे dose बढ़ाएं",
},
{
"disease": "Type 2 – Extra Sugar Control",
"medicine": "Glimepiride, Glipizide (Sulphonylureas)",
"use": "Pancreas से Insulin निकलवाए",
"dose": "1-4 mg सुबह खाने से पहले",
"side_effects": "Hypoglycemia (sugar गिरना), वज़न बढ़ना",
"tip": "खाना न खाएं तो यह गोली न लें",
},
{
"disease": "Type 1 / Severe Type 2",
"medicine": "Insulin (Injection – Regular, NPH, Glargine)",
"use": "Body की insulin replace करे",
"dose": "Doctor-prescribed units",
"side_effects": "Hypoglycemia, injection site पर सूजन",
"tip": "Glucose candy हमेशा साथ रखें",
},
],
},
{
"section": "🦠 Infection (संक्रमण)",
"entries": [
{
"disease": "Bacterial Infection (throat, urine, skin, chest)",
"medicine": "Amoxicillin, Azithromycin (Zithromax), Ciprofloxacin",
"use": "Bacteria की cell wall / protein तोड़े",
"dose": "Doctor के अनुसार – 5-7 दिन",
"side_effects": "Diarrhea, Allergy rash, Gut bacteria नष्ट",
"tip": "पूरा course लें – बीच में बंद न करें",
},
{
"disease": "Fungal Infection (थ्रश, Ringworm, Athlete's foot)",
"medicine": "Fluconazole (oral), Clotrimazole cream",
"use": "Fungal cell membrane तोड़े",
"dose": "Fluconazole 150 mg single dose (thrush)",
"side_effects": "Nausea, Liver (rare)",
"tip": "Cream कम से कम 2 हफ्ते लगाएं",
},
{
"disease": "Viral (Herpes, Cold Sore, Flu)",
"medicine": "Acyclovir (Herpes), Oseltamivir/Tamiflu (Flu)",
"use": "Virus की copying रोके",
"dose": "Acyclovir: 400 mg 3x/day 5 days",
"side_effects": "Nausea, headache, Kidney (Acyclovir)",
"tip": "जल्दी शुरू करें – ज़्यादा असरदार",
},
],
},
{
"section": "🧠 Mental Health (मानसिक स्वास्थ्य)",
"entries": [
{
"disease": "Depression / Anxiety (अवसाद / चिंता)",
"medicine": "Sertraline, Fluoxetine, Escitalopram (SSRIs)",
"use": "Brain में Serotonin बढ़ाए",
"dose": "Doctor के अनुसार – 20-50 mg/day",
"side_effects": "पहले 2 हफ्ते: मतली, नींद न आना; Sexual side effects",
"tip": "4-6 हफ्ते में असर – धैर्य रखें",
},
{
"disease": "Severe Anxiety / Panic Attack",
"medicine": "Alprazolam (Xanax), Clonazepam (Benzodiazepines)",
"use": "Brain को तुरंत शांत करे (GABA बढ़ाए)",
"dose": "0.25-0.5 mg जब ज़रूरत",
"side_effects": "Addiction, नींद, memory कमज़ोर",
"tip": "सिर्फ short-term; अचानक बंद न करें",
},
],
},
{
"section": "🤢 पेट & पाचन (Stomach & Digestion)",
"entries": [
{
"disease": "Acidity / Heartburn (एसिडिटी)",
"medicine": "Omeprazole, Pantoprazole (PPIs)",
"use": "Stomach में acid बनना कम करे",
"dose": "20-40 mg सुबह खाने से 30 min पहले",
"side_effects": "B12, Magnesium, Calcium कमी (लंबे समय में)",
"tip": "8 हफ्ते से ज़्यादा doctor की सलाह से",
},
{
"disease": "Diarrhea (दस्त)",
"medicine": "ORS + Loperamide (Imodium)",
"use": "Gut movement slow करे; पानी-नमक replace",
"dose": "ORS: हर loose stool के बाद",
"side_effects": "Loperamide: Constipation, Bloating",
"tip": "Severe infection में Loperamide avoid",
},
{
"disease": "Constipation (कब्ज़)",
"medicine": "Lactulose, Bisacodyl (Dulcolax), Isabgol",
"use": "Stool को नरम/push करे",
"dose": "Isabgol: 1 tsp रात पानी के साथ",
"side_effects": "Bloating, Cramps",
"tip": "ढेर सारा पानी ज़रूरी",
},
{
"disease": "Nausea / Vomiting (मतली / उल्टी)",
"medicine": "Ondansetron (Emeset), Domperidone (Domstal)",
"use": "Vomiting centre block करे",
"dose": "4-8 mg; Domperidone 10 mg खाने से पहले",
"side_effects": "Headache, Constipation",
"tip": "Pregnancy में doctor की सलाह लें",
},
],
},
{
"section": "🦴 हड्डी & जोड़ (Bone & Joint)",
"entries": [
{
"disease": "Osteoporosis (कमज़ोर हड्डियाँ)",
"medicine": "Alendronate (Fosamax), Calcium + Vit D3",
"use": "Bone breakdown slow करे",
"dose": "Alendronate: 70 mg हफ्ते में एक बार",
"side_effects": "Esophagus में जलन, Jaw problem (rare)",
"tip": "खाली पेट + पूरे गिलास पानी के साथ; 30 min तक लेट न जाएं",
},
{
"disease": "Gout (गाउट – Uric Acid बढ़ना)",
"medicine": "Allopurinol (लंबे समय), Colchicine (attack में)",
"use": "Uric acid कम करे / जोड़ों की सूजन घटाए",
"dose": "Allopurinol: 100-300 mg/day",
"side_effects": "Colchicine: Diarrhea, Nausea",
"tip": "ज़्यादा पानी पिएं; Red meat, Beer कम करें",
},
],
},
{
"section": "🩺 Thyroid & Hormones",
"entries": [
{
"disease": "Hypothyroidism (थायरॉइड कम)",
"medicine": "Levothyroxine (Eltroxin, Thyronorm)",
"use": "Missing thyroid hormone replace करे",
"dose": "Doctor-prescribed – सुबह खाली पेट",
"side_effects": "अधिक dose: Heart palpitations, Weight loss",
"tip": "Coffee/milk से 30 min पहले लें",
},
],
},
]
# ── Build PDF ─────────────────────────────────────────────────────────────────
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
topMargin=1.8*cm,
bottomMargin=2*cm,
leftMargin=1.5*cm,
rightMargin=1.5*cm,
title="Common Medicines Guide",
author="Orris Health",
)
S = make_styles()
W = A4[0] - 3*cm # usable width
story = []
# ── Cover block ───────────────────────────────────────────────────────────
cover_data = [[
Paragraph("🍋 Common Medicines Guide", S["title"]),
]]
cover_table = Table(cover_data, colWidths=[W])
cover_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LEMON),
("ALIGN", (0,0), (-1,-1), "CENTER"),
("TOPPADDING", (0,0), (-1,-1), 14),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [8]),
]))
story.append(cover_table)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("आम बीमारियाँ • दवाइयाँ • Use • Side Effects — सरल भाषा में", S["subtitle"]))
story.append(HRFlowable(width=W, color=LEMON_DARK, thickness=2, spaceAfter=8))
# ── Table header row ──────────────────────────────────────────────────────
col_widths = [3.8*cm, 3.8*cm, 2.4*cm, 2.6*cm, 3.8*cm, 2.0*cm]
header_style = ParagraphStyle(
"TH", fontSize=8, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_CENTER
)
cell_style = ParagraphStyle(
"TD", fontSize=7.5, fontName="Helvetica",
textColor=TEXT_DARK, leading=10
)
med_style = ParagraphStyle(
"MED", fontSize=7.5, fontName="Helvetica-Bold",
textColor=BLUE_SOFT, leading=10
)
se_style = ParagraphStyle(
"SE", fontSize=7.5, fontName="Helvetica",
textColor=RED_SOFT, leading=10
)
tip_style = ParagraphStyle(
"TIP", fontSize=7, fontName="Helvetica-Oblique",
textColor=ACCENT_GREEN, leading=9
)
headers = ["बीमारी", "दवाई (Medicine)", "Use", "Dose", "Side Effects", "Tip"]
for section_data in DISEASES:
# Section heading row spanning full width
sec_para = Paragraph(section_data["section"], S["section"])
sec_table = Table([[sec_para]], colWidths=[W])
sec_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), ACCENT_GREEN),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(KeepTogether([sec_table, Spacer(1, 2)]))
# Build table rows for this section
table_data = [
[Paragraph(h, header_style) for h in headers]
]
row_styles = [
("BACKGROUND", (0,0), (-1,0), LEMON_DARK),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 8),
("ALIGN", (0,0), (-1,-1), "LEFT"),
("VALIGN", (0,0), (-1,-1), "TOP"),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#E0E0E0")),
("ROWBACKGROUNDS", (0,1), (-1,-1), [LEMON_LIGHT, WHITE]),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
]
for i, entry in enumerate(section_data["entries"]):
row = [
Paragraph(entry["disease"], cell_style),
Paragraph(entry["medicine"], med_style),
Paragraph(entry["use"], cell_style),
Paragraph(entry["dose"], cell_style),
Paragraph(entry["side_effects"], se_style),
Paragraph(entry["tip"], tip_style),
]
table_data.append(row)
t = Table(table_data, colWidths=col_widths, repeatRows=1)
t.setStyle(TableStyle(row_styles))
story.append(KeepTogether([t, Spacer(1, 6)]))
# ── Golden Rules box ──────────────────────────────────────────────────────
rules_style = ParagraphStyle(
"Rules", fontSize=8.5, fontName="Helvetica",
textColor=TEXT_DARK, leading=13
)
rules_title = ParagraphStyle(
"RulesTitle", fontSize=11, fontName="Helvetica-Bold",
textColor=ACCENT_GREEN, spaceAfter=4
)
rules = [
Paragraph("⚠️ ज़रूरी नियम (Golden Rules)", rules_title),
Paragraph("✅ Antibiotic सिर्फ Bacterial infection में – Virus में काम नहीं करता", rules_style),
Paragraph("✅ Antibiotic का पूरा course लें – बीच में बंद न करें", rules_style),
Paragraph("✅ Pain killer (NSAID) हमेशा खाने के साथ", rules_style),
Paragraph("✅ BP / Thyroid / Diabetes की दवाई कभी खुद बंद न करें", rules_style),
Paragraph("✅ सभी दवाइयाँ doctor को बताएं (Drug interactions होते हैं)", rules_style),
Paragraph("✅ Paracetamol safe है – लेकिन 4 gram/day से ज़्यादा नहीं", rules_style),
Paragraph("✅ Nasal spray 5 दिन से ज़्यादा नहीं", rules_style),
Paragraph("✅ Benzodiazepine (Xanax आदि) habit बनाती है – सिर्फ short-term", rules_style),
]
rules_table = Table([[rules]], colWidths=[W])
rules_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LEMON_MID),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("BOX", (0,0), (-1,-1), 1.5, LEMON_DARK),
("ROUNDEDCORNERS", [6]),
]))
story.append(Spacer(1, 0.4*cm))
story.append(rules_table)
# ── Footer ────────────────────────────────────────────────────────────────
story.append(Spacer(1, 0.3*cm))
story.append(HRFlowable(width=W, color=LEMON_DARK, thickness=1))
story.append(Paragraph(
"🍋 यह guide सामान्य जानकारी के लिए है। किसी भी दवाई से पहले Doctor / Pharmacist की सलाह लें। | Orris Health 2026",
S["footer"]
))
doc.build(story)
print(f"PDF created: {OUTPUT}")
build_pdf()
cd /home/daytona/workspace/medicine-pdf && python create_medicine_pdf.py 2>&1
ls -lh /home/daytona/workspace/medicine-pdf/Common_Medicines_Guide.pdf
Common Medicines Guide
PDF Document · PDF
| Section | बीमारियाँ |
|---|---|
| 🤒 बुखार / दर्द | Paracetamol, Ibuprofen, Diclofenac |
| 🤧 सर्दी / एलर्जी | Cetirizine, Nasal Spray, Cough Syrup |
| 🫁 दमा / सांस | Salbutamol (Blue), Budesonide (Brown) |
| ❤️ BP / Heart / Cholesterol | Amlodipine, Statins, Aspirin 75mg |
| 🩸 Diabetes | Metformin, Glimepiride, Insulin |
| 🦠 Infection | Antibiotics, Antifungals, Antivirals |
| 🧠 Mental Health | SSRIs, Benzodiazepines |
| 🤢 पेट / पाचन | Omeprazole, ORS, Loperamide, Ondansetron |
| 🦴 हड्डी / जोड़ | Alendronate, Allopurinol, Colchicine |
| 🩺 Thyroid | Levothyroxine |
Add this PDF to Word document with notes section
cd /home/daytona/workspace/medicine-pdf && pdftoppm -jpeg -r 180 Common_Medicine…
~/medicine-pdf/create_docx.js
const {
Document, Packer, Paragraph, TextRun, ImageRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, VerticalAlign,
ShadingType, PageBreak, Header, Footer, PageNumber, NumberFormat,
convertInchesToTwip, UnderlineType
} = require('docx');
const fs = require('fs');
const path = require('path');
const DIR = '/home/daytona/workspace/medicine-pdf/';
const OUT = DIR + 'Common_Medicines_Guide_with_Notes.docx';
// ── Colors ──────────────────────────────────────────────────────────────────
const LEMON_BG = "FFFDE7"; // pale lemon
const LEMON_YEL = "F5E642"; // bright lemon
const AMBER = "F9A825"; // amber / lemon skin
const GREEN_DARK = "33691E"; // leaf green
const WHITE = "FFFFFF";
const LIGHT_GREY = "F5F5F5";
const GREY_BDR = "BDBDBD";
// ── Helper: make a horizontal line paragraph ────────────────────────────────
function hrLine(color = AMBER) {
return new Paragraph({
border: { bottom: { color, size: 12, style: BorderStyle.SINGLE } },
spacing: { after: 80 },
});
}
// ── Helper: shaded heading paragraph ────────────────────────────────────────
function sectionHeading(text) {
return new Paragraph({
children: [
new TextRun({
text,
bold: true,
color: WHITE,
size: 24,
font: "Calibri",
}),
],
shading: { type: ShadingType.CLEAR, fill: GREEN_DARK },
spacing: { before: 200, after: 80 },
indent: { left: convertInchesToTwip(0.1) },
});
}
// ── Helper: notes line (lined blank row) ────────────────────────────────────
function notesLine(label = "") {
return new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
children: label
? [new TextRun({ text: label, bold: true, color: GREEN_DARK, size: 18, font: "Calibri" })]
: [new TextRun({ text: "" })],
spacing: { after: 0 },
}),
],
width: { size: 25, type: WidthType.PERCENTAGE },
shading: { type: ShadingType.CLEAR, fill: LEMON_BG },
borders: {
bottom: { style: BorderStyle.SINGLE, size: 4, color: AMBER },
top: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
},
margins: { top: 60, bottom: 60, left: 80, right: 80 },
}),
new TableCell({
children: [new Paragraph({ children: [new TextRun({ text: "" })] })],
width: { size: 75, type: WidthType.PERCENTAGE },
borders: {
bottom: { style: BorderStyle.SINGLE, size: 4, color: AMBER },
top: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
},
margins: { top: 60, bottom: 60, left: 80, right: 80 },
}),
],
height: { value: 400, rule: "atLeast" },
});
}
// ── Load page images ─────────────────────────────────────────────────────────
const pages = ['page-1.jpg', 'page-2.jpg', 'page-3.jpg']
.filter(f => fs.existsSync(DIR + f))
.map(f => fs.readFileSync(DIR + f));
// ── Build page-image paragraphs ──────────────────────────────────────────────
function makePageImage(imgBuffer, pageNum) {
return [
new Paragraph({
children: [
new TextRun({
text: `Page ${pageNum}`,
bold: true, color: AMBER, size: 18, font: "Calibri",
}),
],
spacing: { before: 100, after: 60 },
}),
new Paragraph({
children: [
new ImageRun({
data: imgBuffer,
transformation: { width: 620, height: 878 },
type: "jpg",
}),
],
alignment: AlignmentType.CENTER,
spacing: { after: 200 },
}),
];
}
// ── Notes section topics ─────────────────────────────────────────────────────
const NOTE_TOPICS = [
"बुखार / दर्द",
"सर्दी / एलर्जी",
"दमा / सांस",
"BP / Heart / Cholesterol",
"Diabetes",
"Infection / Antibiotics",
"Mental Health",
"पेट / पाचन",
"हड्डी / जोड़",
"Thyroid",
"Important Reminders",
"My Medicines (Personal)",
"Doctor Notes",
"Allergies / Reactions",
"Other Notes",
];
// ── Assemble document ────────────────────────────────────────────────────────
const pdfPageChildren = [];
pages.forEach((buf, i) => {
pdfPageChildren.push(...makePageImage(buf, i + 1));
});
// Notes section children
const notesChildren = [
new Paragraph({
children: [
new TextRun({ text: "📝 Notes Section", bold: true, size: 36, color: GREEN_DARK, font: "Calibri" }),
],
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 100 },
shading: { type: ShadingType.CLEAR, fill: LEMON_YEL },
}),
new Paragraph({
children: [
new TextRun({
text: "अपनी दवाइयाँ, Doctor के notes, और ज़रूरी जानकारी यहाँ लिखें",
italics: true, color: GREEN_DARK, size: 20, font: "Calibri",
}),
],
alignment: AlignmentType.CENTER,
spacing: { after: 200 },
}),
hrLine(),
];
NOTE_TOPICS.forEach(topic => {
notesChildren.push(sectionHeading(topic));
notesChildren.push(
new Table({
rows: [
notesLine("दवाई:"),
notesLine("Dose:"),
notesLine("Side Effect:"),
notesLine("मेरी Note:"),
],
width: { size: 100, type: WidthType.PERCENTAGE },
margins: { top: 40, bottom: 40, left: 40, right: 40 },
})
);
notesChildren.push(new Paragraph({ spacing: { after: 120 } }));
});
// Extra blank writing lines
notesChildren.push(sectionHeading("✏️ Free Notes (अपने notes यहाँ लिखें)"));
for (let i = 0; i < 18; i++) {
notesChildren.push(
new Paragraph({
border: { bottom: { color: AMBER, size: 6, style: BorderStyle.SINGLE } },
spacing: { after: 320 },
})
);
}
const doc = new Document({
creator: "Orris Health",
title: "Common Medicines Guide with Notes",
description: "आम बीमारियाँ, दवाइयाँ, Side Effects – Notes के साथ",
styles: {
default: {
document: {
run: { font: "Calibri", size: 22, color: "212121" },
},
},
},
sections: [
// ── Section 1: Cover + PDF pages ─────────────────────────────────────
{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 800, right: 800 },
},
},
headers: {
default: new Header({
children: [
new Paragraph({
children: [
new TextRun({ text: "🍋 Common Medicines Guide", bold: true, color: GREEN_DARK, size: 20, font: "Calibri" }),
new TextRun({ text: " | आम बीमारियाँ • दवाइयाँ • Side Effects", color: AMBER, size: 18, font: "Calibri" }),
],
border: { bottom: { color: AMBER, size: 8, style: BorderStyle.SINGLE } },
spacing: { after: 60 },
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({ text: "Orris Health 2026 | यह guide सामान्य जानकारी के लिए है। किसी भी दवाई से पहले Doctor की सलाह लें। | Page ", color: "888888", size: 16, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], color: "888888", size: 16 }),
],
alignment: AlignmentType.CENTER,
border: { top: { color: AMBER, size: 6, style: BorderStyle.SINGLE } },
spacing: { before: 60 },
}),
],
}),
},
children: [
// Title block
new Paragraph({
children: [
new TextRun({ text: "🍋 Common Medicines Guide", bold: true, size: 52, color: GREEN_DARK, font: "Calibri" }),
],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.CLEAR, fill: LEMON_YEL },
spacing: { before: 200, after: 80 },
}),
new Paragraph({
children: [
new TextRun({
text: "आम बीमारियाँ • दवाइयाँ • Use • Side Effects — सरल हिंदी में",
italics: true, size: 22, color: AMBER, font: "Calibri",
}),
],
alignment: AlignmentType.CENTER,
spacing: { after: 40 },
}),
hrLine(),
new Paragraph({
children: [
new TextRun({ text: "📋 PDF Guide — सभी Pages", bold: true, size: 26, color: GREEN_DARK, font: "Calibri" }),
],
spacing: { before: 120, after: 80 },
}),
...pdfPageChildren,
],
},
// ── Section 2: Notes ─────────────────────────────────────────────────
{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 800, right: 800 },
},
},
headers: {
default: new Header({
children: [
new Paragraph({
children: [
new TextRun({ text: "📝 Notes Section — अपनी दवाइयाँ और Doctor के Notes", bold: true, color: GREEN_DARK, size: 20, font: "Calibri" }),
],
border: { bottom: { color: AMBER, size: 8, style: BorderStyle.SINGLE } },
spacing: { after: 60 },
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({ text: "Orris Health 2026 | Page ", color: "888888", size: 16, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], color: "888888", size: 16 }),
],
alignment: AlignmentType.CENTER,
border: { top: { color: AMBER, size: 6, style: BorderStyle.SINGLE } },
spacing: { before: 60 },
}),
],
}),
},
children: notesChildren,
},
],
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync(OUT, buf);
console.log("DOCX created:", OUT);
}).catch(err => {
console.error("Error:", err);
process.exit(1);
});
cd /home/daytona/workspace/medicine-pdf && node create_docx.js 2>&1
cd /home/daytona/workspace/medicine-pdf && python /home/daytona/skills/docx/scri…
ls -lh /home/daytona/workspace/medicine-pdf/Common_Medicines_Guide_with_Notes.do…
Common Medicines Guide with Notes
Word Document · DOCX
| Field | Description |
|---|---|
| दवाई | आपकी medicine का नाम |
| Dose | कितनी और कब |
| Side Effect | जो आपने notice किया |
| मेरी Note | personal reminder |