Make this pdf of periodontal disease into pptx . Make like prepare by human ( less use of color and symbol) and add diagram and table which are present in pdf
cd /home/daytona/workspace && python3 - << 'EOF' import pdfplumber pdf_path = "/home/daytona/workspace/attachments/e1428ee7-a160-450f-af79-7a03a7f02b41/Here is the complete content from the PDF all 10 .pdf" with pdfplumber.open(pdf_path) as pdf: print(f"Total pages: {len(pdf.pages)}") for i, page in enumerate(pdf.pages): print(f"\n{'='*60}") print(f"PAGE {i+1}") print('='*60) text = page.extract_text() if text: print(text[:3000]) tables = page.extract_tables() if tables: print(f"\n--- TABLES ON PAGE {i+1} ---") for j, tbl in enumerate(tables): print(f"Table {j+1}:") for row in tbl: print(row) EOF
cd /home/daytona/workspace && python3 - << 'EOF' import pdfplumber import fitz # PyMuPDF import os pdf_path = "/home/daytona/workspace/attachments/e1428ee7-a160-450f-af79-7a03a7f02b41/Here is the complete content from the PDF all 10 .pdf" # Extract images using PyMuPDF os.makedirs("/home/daytona/workspace/perio-pptx/images", exist_ok=True) doc = fitz.open(pdf_path) img_count = 0 for page_num in range(len(doc)): page = doc[page_num] image_list = page.get_images(full=True) for img_index, img in enumerate(image_list): xref = img[0] base_image = doc.extract_image(xref) img_bytes = base_image["image"] ext = base_image["ext"] img_path = f"/home/daytona/workspace/perio-pptx/images/page{page_num+1}_img{img_index+1}.{ext}" with open(img_path, "wb") as f: f.write(img_bytes) print(f"Saved: {img_path} ({len(img_bytes)} bytes)") img_count += 1 print(f"\nTotal images extracted: {img_count}") doc.close() EOF
mkdir -p /home/daytona/workspace/perio-pptx && ls /home/daytona/workspace/perio-pptx/
~/perio-pptx/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Periodontal Disease";
pres.author = "Medical Notes";
// ─── COLOUR PALETTE (minimal, human-prepared look) ───
const C = {
black: "1A1A1A",
darkGray: "333333",
midGray: "555555",
gray: "777777",
lightGray:"F2F2F2",
border: "AAAAAA",
white: "FFFFFF",
accent: "2C5F8A", // single muted blue accent
accentLt: "D6E4F0", // very light blue for table headers
red: "B03030", // used sparingly for warnings
yellow: "FFF8DC", // keynote box backgrounds
};
// Helper: slide title bar
function addTitle(slide, text, sub) {
slide.addShape(pres.ShapeType.rect, {
x: 0, y: 0, w: 10, h: 0.75,
fill: { color: C.accent },
line: { color: C.accent },
});
slide.addText(text, {
x: 0.2, y: 0, w: 9.6, h: 0.75,
fontSize: 22, bold: true, color: C.white,
valign: "middle", fontFace: "Calibri", margin: 0,
});
if (sub) {
slide.addText(sub, {
x: 0.2, y: 0.75, w: 9.6, h: 0.3,
fontSize: 11, italic: true, color: C.gray,
fontFace: "Calibri", margin: 0,
});
}
}
// Helper: section divider slide
function sectionSlide(label) {
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color: C.lightGray}, line:{color:C.lightGray} });
s.addShape(pres.ShapeType.rect, { x:0, y:2.3, w:10, h:1.1, fill:{color: C.accent}, line:{color:C.accent} });
s.addText(label, {
x:0.3, y:2.3, w:9.4, h:1.1,
fontSize:28, bold:true, color:C.white,
valign:"middle", fontFace:"Calibri", align:"center",
});
}
// Helper: body text (bullet)
function bullet(slide, items, x, y, w, h, opts={}) {
const arr = items.map((t, i) => ({
text: t,
options: { bullet: true, breakLine: i < items.length - 1, fontSize: opts.fontSize||13, color: C.darkGray, fontFace:"Calibri" }
}));
slide.addText(arr, { x, y, w, h, valign:"top", ...opts });
}
// Helper: plain paragraph
function para(slide, text, x, y, w, h, opts={}) {
slide.addText(text, { x, y, w, h, fontSize:12, color:C.darkGray, fontFace:"Calibri", valign:"top", wrap:true, ...opts });
}
// Helper: note box
function noteBox(slide, text, x, y, w, h, bgColor) {
slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{color: bgColor||C.yellow}, line:{color:C.border, width:0.5} });
slide.addText(text, { x:x+0.1, y:y+0.05, w:w-0.2, h:h-0.1, fontSize:11, color:C.darkGray, fontFace:"Calibri", wrap:true, valign:"middle" });
}
// ═══════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{color:C.white}, line:{color:C.white} });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:1.2, fill:{color:C.accent}, line:{color:C.accent} });
s.addText("PERIODONTAL DISEASE", {
x:0.3, y:0.1, w:9.4, h:1.0,
fontSize:32, bold:true, color:C.white, fontFace:"Calibri",
valign:"middle", align:"center",
});
s.addText("A Structured Overview: Anatomy · Microbiology · Classification · Management", {
x:0.5, y:1.4, w:9, h:0.5,
fontSize:14, color:C.midGray, fontFace:"Calibri", align:"center", italic:true,
});
// horizontal divider
s.addShape(pres.ShapeType.line, { x:1, y:2.1, w:8, h:0, line:{color:C.border, width:0.8} });
s.addText("Sources: Harrison's Principles of Internal Medicine 22e · Robbins & Cotran Pathologic Basis of Disease\nJunqueira's Basic Histology · Sherris Medical Microbiology · Tintinalli's Emergency Medicine", {
x:0.5, y:2.3, w:9, h:0.8,
fontSize:10, color:C.gray, fontFace:"Calibri", align:"center", italic:true,
});
// analogy box
s.addShape(pres.ShapeType.rect, { x:1.5, y:3.3, w:7, h:1.7, fill:{color:C.accentLt}, line:{color:C.accent, width:0.5} });
s.addText([
{ text: "Think of your tooth like a FENCE POST.\n", options:{bold:true, fontSize:12, color:C.accent} },
{ text: "The post (tooth) must be held firmly in the GROUND (jawbone).\n", options:{fontSize:11, color:C.darkGray} },
{ text: "PERIODONTIUM = everything that holds the tooth in place.\n", options:{fontSize:11, color:C.darkGray} },
{ text: "Periodontal disease = the slow destruction of this support system by bacteria.", options:{fontSize:11, color:C.darkGray} },
], { x:1.7, y:3.4, w:6.6, h:1.5, valign:"top", fontFace:"Calibri", wrap:true });
}
// ═══════════════════════════════════════════════════
// SLIDE 2 — ANATOMY OF THE PERIODONTIUM
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Anatomy of the Periodontium", "The four structures that support every tooth");
// LEFT: labelled diagram (drawn with shapes + text)
// Tooth outline
s.addShape(pres.ShapeType.rect, { x:1.0, y:1.1, w:1.2, h:3.8, fill:{color:"F0EAD6"}, line:{color:C.border, width:0.7} });
s.addText("TOOTH\n(Enamel/Dentin/Pulp)", { x:0.95, y:2.3, w:1.3, h:0.8, fontSize:7, color:C.midGray, align:"center", fontFace:"Calibri" });
// Gingiva
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.1, w:0.7, h:1.2, fill:{color:"FFCCCC"}, line:{color:C.border, width:0.5} });
s.addText("Gingiva\n(Gum)", { x:0.05, y:1.1, w:0.9, h:0.5, fontSize:7, color:C.darkGray, align:"center", fontFace:"Calibri" });
// Free gingiva label
s.addText("Free gingiva", { x:0.05, y:1.65, w:1.0, h:0.25, fontSize:7, italic:true, color:C.midGray, fontFace:"Calibri" });
// Attached gingiva label
s.addShape(pres.ShapeType.rect, { x:0.3, y:2.3, w:0.7, h:0.6, fill:{color:"FFAAAA"}, line:{color:C.border, width:0.5} });
s.addText("Attached gingiva", { x:0.05, y:2.35, w:1.0, h:0.25, fontSize:7, italic:true, color:C.midGray, fontFace:"Calibri" });
// PDL
s.addShape(pres.ShapeType.rect, { x:2.2, y:1.8, w:0.4, h:2.5, fill:{color:"D4EDDA"}, line:{color:C.border, width:0.5} });
s.addText("PDL", { x:2.65, y:2.9, w:1.0, h:0.3, fontSize:7, color:C.darkGray, fontFace:"Calibri" });
s.addShape(pres.ShapeType.line, { x:2.62, y:3.0, w:0.3, h:0, line:{color:C.gray, width:0.5} });
// Cementum
s.addShape(pres.ShapeType.rect, { x:2.18, y:1.78, w:0.15, h:2.6, fill:{color:"E8D5B7"}, line:{color:C.border, width:0.4} });
s.addText("Cementum", { x:2.65, y:3.3, w:1.2, h:0.25, fontSize:7, color:C.darkGray, fontFace:"Calibri" });
// Alveolar bone
s.addShape(pres.ShapeType.rect, { x:0.3, y:2.9, w:0.7, h:1.9, fill:{color:"EAE0D5"}, line:{color:C.border, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:2.6, y:2.9, w:0.5, h:1.9, fill:{color:"EAE0D5"}, line:{color:C.border, width:0.5} });
s.addText("Alveolar bone", { x:3.15, y:3.7, w:1.3, h:0.25, fontSize:7, color:C.darkGray, fontFace:"Calibri" });
s.addShape(pres.ShapeType.line, { x:3.12, y:3.8, w:0.3, h:0, line:{color:C.gray, width:0.4} });
// Sulcus / JE annotation
s.addText("Gingival sulcus", { x:1.05, y:1.2, w:1.2, h:0.2, fontSize:6.5, color:C.red, align:"center", fontFace:"Calibri" });
s.addText("Junctional epithelium (JE)", { x:1.05, y:1.55, w:1.3, h:0.2, fontSize:6, italic:true, color:C.midGray, align:"center", fontFace:"Calibri" });
// Diagram caption
s.addText("Figure 1 — Dental anatomic unit & attachment apparatus", {
x:0.2, y:4.95, w:4.2, h:0.3,
fontSize:8, italic:true, color:C.gray, fontFace:"Calibri",
});
// RIGHT: key facts
s.addText("Key Components", { x:4.7, y:1.0, w:5, h:0.35, fontSize:14, bold:true, color:C.accent, fontFace:"Calibri" });
const rows = [
["Structure","Key Facts"],
["Gingiva (Gum)","Free gingiva + attached gingiva. Covers bone and protects tooth roots."],
["Periodontal Ligament (PDL)","Collagen fibres anchoring cementum to alveolar bone. Absorbs biting forces."],
["Cementum","Calcified tissue covering tooth root. PDL fibres insert here."],
["Alveolar Bone","Surrounds and supports root. Destroyed irreversibly in periodontitis."],
["Gingival Sulcus","Space between free gingiva and tooth. Normal depth 2–3 mm."],
["Junctional Epithelium","Seals the base of the sulcus. First barrier against bacteria."],
];
s.addTable(rows, {
x:4.6, y:1.4, w:5.1, h:3.8,
fontSize:9.5, fontFace:"Calibri",
align:"left", valign:"middle",
border: { type:"solid", color:C.border, pt:0.5 },
colW:[1.8, 3.3],
rowH: 0.52,
fill: C.white,
color: C.darkGray,
autoPage: false,
});
noteBox(s, "Normal sulcus depth = 2–3 mm. Anything deeper = pathological pocket = disease.", 0.2, 5.0, 4.3, 0.45, C.yellow);
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Microbiology of Periodontal Disease");
// ═══════════════════════════════════════════════════
// SLIDE 3 — DENTAL PLAQUE & CALCULUS
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Dental Plaque and Calculus", "The primary aetiological agents");
// Plaque formation diagram (flow boxes)
const boxes = [
{ label:"Dental Plaque\n(Biofilm)", x:0.3, bg:"F5F5F5" },
{ label:"Not removed\ndaily", x:2.4, bg:"F5F5F5" },
{ label:"Calculus\n(Tartar)", x:4.5, bg:"EAE0D5" },
{ label:"Subgingival\nColonisation", x:6.6, bg:"FDDCDC" },
];
boxes.forEach(b => {
s.addShape(pres.ShapeType.rect, { x:b.x, y:1.1, w:1.9, h:0.85, fill:{color:b.bg}, line:{color:C.border, width:0.6} });
s.addText(b.label, { x:b.x+0.05, y:1.12, w:1.8, h:0.81, fontSize:9, color:C.darkGray, align:"center", valign:"middle", fontFace:"Calibri" });
});
// arrows
[2.2, 4.3, 6.4].forEach(ax => {
s.addShape(pres.ShapeType.line, { x:ax, y:1.53, w:0.25, h:0, line:{color:C.gray, width:1.2} });
s.addText("→", { x:ax+0.2, y:1.4, w:0.3, h:0.3, fontSize:12, color:C.gray, fontFace:"Calibri" });
});
s.addText("Progression of Plaque to Disease", { x:0.3, y:0.8, w:9, h:0.28, fontSize:10, bold:true, italic:true, color:C.midGray, fontFace:"Calibri" });
// Key facts
para(s, "Dental plaque = sticky colourless biofilm of bacteria + salivary proteins + dead cells. Forms constantly on tooth surfaces.", 0.3, 2.15, 9.4, 0.45);
// Supragingival vs Subgingival table
s.addText("Supragingival vs. Subgingival Plaque", { x:0.3, y:2.65, w:9.4, h:0.3, fontSize:12, bold:true, color:C.accent, fontFace:"Calibri" });
s.addTable([
[{text:"Feature", options:{bold:true}}, {text:"Supragingival Plaque", options:{bold:true}}, {text:"Subgingival Plaque", options:{bold:true}}],
["Location","Above the gumline","Below the gumline (in the pocket)"],
["Visibility","Visible as white/yellow film","Hidden — cannot be seen clinically"],
["Oxygen","Aerobic organisms","Anaerobic organisms predominate"],
["Danger","Mainly gingivitis","Main cause of bone destruction"],
["Removal","Daily brushing/flossing","Professional scaling required"],
], {
x:0.3, y:2.95, w:9.4, h:2.5,
fontSize:10, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.2, 3.6, 3.6],
rowH:0.42,
color: C.darkGray,
autoPage:false,
});
noteBox(s, "Calculus CANNOT be removed by brushing — only by professional scaling.", 0.3, 5.45, 9.4, 0.42, C.accentLt);
}
// ═══════════════════════════════════════════════════
// SLIDE 4 — KEY PATHOGENS
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Key Periodontal Pathogens", "Microbiology — Red Complex and Aggressive Organisms");
s.addTable([
[{text:"Organism", options:{bold:true}}, {text:"Complex / Group", options:{bold:true}}, {text:"Disease Association", options:{bold:true}}, {text:"Mnemonic / Note", options:{bold:true}}],
["Porphyromonas gingivalis (Pg)","RED COMPLEX","Chronic periodontitis — MAJOR CULPRIT","P G T = \"Red Complex\""],
["Tannerella forsythia (Tf)","RED COMPLEX","Chronic periodontitis",""],
["Treponema denticola (Td)","RED COMPLEX","Chronic periodontitis","Spirochaete"],
["Aggregatibacter actinomycetemcomitans (Aa)","AGGRESSIVE / JUVENILE","Localised Aggressive Periodontitis (LAP)","Previously Actinobacillus"],
["Prevotella intermedia","ORANGE COMPLEX","Gingivitis (esp. pregnancy-associated)","Hormone-sensitive"],
["Fusobacterium nucleatum","ORANGE COMPLEX","Bridges early and late colonisers","Key bridging organism"],
["Treponema + Fusobacterium + Selenomonas","ANUG consortium","ANUG / NUP","Triple mix in ANUG"],
], {
x:0.2, y:0.9, w:9.6, h:4.4,
fontSize:9.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.8, 1.8, 2.8, 2.2],
rowH:0.57,
color: C.darkGray,
autoPage:false,
});
noteBox(s, "RED COMPLEX \"P G T\" = Porphyromonas gingivalis + Tannerella forsythia + Treponema denticola\n(Most virulent group — strongly associated with bone destruction)", 0.2, 5.25, 9.6, 0.55, C.accentLt);
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Pathogenesis & Disease Progression");
// ═══════════════════════════════════════════════════
// SLIDE 5 — PATHOGENESIS FLOWCHART
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Pathogenesis of Periodontal Disease", "How bacteria destroy bone and attachment");
// Flow diagram: 5 stages in boxes with arrows
const stages = [
{ label:"HEALTHY\nGUMS", sub:"Normal sulcus\n2–3 mm", bg:"D4EDDA", tc:C.darkGray },
{ label:"GINGIVITIS", sub:"BOP, redness,\nswelling — bone safe!", bg:"FFF3CD", tc:C.darkGray },
{ label:"EARLY\nPERIODONTITIS", sub:"Pocket 4–5 mm\nBone loss begins", bg:"FFE0B2", tc:C.darkGray },
{ label:"MODERATE\nPERIODONTITIS", sub:"Pocket 5–7 mm\nMore bone loss", bg:"FFCCBC", tc:C.darkGray },
{ label:"SEVERE\nPERIODONTITIS", sub:"Pocket >7 mm\nTooth mobility", bg:"FFCDD2", tc:"B03030" },
];
stages.forEach((st, i) => {
const bx = 0.2 + i * 1.95;
s.addShape(pres.ShapeType.rect, { x:bx, y:1.05, w:1.75, h:1.1, fill:{color:st.bg}, line:{color:C.border, width:0.6} });
s.addText(st.label, { x:bx+0.05, y:1.06, w:1.65, h:0.55, fontSize:8.5, bold:true, color:st.tc, align:"center", valign:"middle", fontFace:"Calibri" });
s.addText(st.sub, { x:bx+0.05, y:1.58, w:1.65, h:0.52, fontSize:7, color:C.midGray, align:"center", valign:"top", fontFace:"Calibri" });
if (i < stages.length - 1) {
s.addText("→", { x:bx+1.78, y:1.4, w:0.2, h:0.35, fontSize:14, color:C.gray, fontFace:"Calibri" });
}
});
// TOOTH LOSS at end
s.addShape(pres.ShapeType.rect, { x:0.2+5*1.95, y:1.05, w:1.75, h:1.1, fill:{color:"EF9A9A"}, line:{color:C.red, width:1} });
// (only 5 boxes fit; describe tooth loss in text)
// Key rule banner
noteBox(s, "KEY RULE: Gingivitis = REVERSIBLE (bone is safe). Periodontitis = IRREVERSIBLE (lost bone cannot be fully regrown).", 0.2, 2.3, 9.6, 0.5, "FFF3CD");
// Mechanism steps
s.addText("Mechanism of Tissue Destruction", { x:0.2, y:2.95, w:9.6, h:0.3, fontSize:12, bold:true, color:C.accent, fontFace:"Calibri" });
const steps = [
["Step 1","Bacterial plaque accumulates in gingival sulcus"],
["Step 2","LPS & toxins from Pg, Tf, Td trigger innate immune response"],
["Step 3","PMNs and macrophages release IL-1β, TNF-α, PGE2, MMPs"],
["Step 4","OSTEOCLAST activation → alveolar bone resorption → PERMANENT"],
["Step 5","Pocket deepens → more anaerobic bacteria → cycle accelerates"],
["Step 6","Collagen destruction + epithelial migration → attachment loss"],
];
s.addTable(
[
[{text:"Step",options:{bold:true}},{text:"Event",options:{bold:true}}],
...steps.map(r => [r[0], r[1]])
],
{
x:0.2, y:3.28, w:9.6, h:2.1,
fontSize:9.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[1.1, 8.5], rowH:0.3,
color: C.darkGray, autoPage:false,
}
);
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Classification of Periodontal Diseases");
// ═══════════════════════════════════════════════════
// SLIDE 6 — CLASSIFICATION TABLE
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Classification of Periodontal Diseases", "Major categories with clinical features");
s.addTable([
[
{text:"Disease",options:{bold:true}},
{text:"Key Features",options:{bold:true}},
{text:"Reversible?",options:{bold:true}},
{text:"Note",options:{bold:true}},
],
["Chronic Gingivitis","Redness, BOP, swelling. No bone loss. No pocket depth increase.","YES","Most common. Plaque-induced."],
["Chronic Periodontitis","Pockets, bone loss, attachment loss. Usually PAINLESS.","NO (bone loss)","Most common periodontitis."],
["Aggressive Periodontitis — Localised (LAP)","Young patients (<30 yrs). Affects 1st molars + incisors. Rapid bone loss.","NO","Aa is key pathogen."],
["Aggressive Periodontitis — Generalised (GAP)","Young patients. Affects ≥3 teeth beyond 1st molars/incisors.","NO","Impaired neutrophil function."],
["ANUG (Acute Necrotising Ulcerative Gingivitis)","TRIAD: Pain + Punched-out papillae + Bleeding. Grey pseudomembrane. FETID breath.","Partial","Stress, smoking, HIV risk factors."],
["Necrotising Ulcerative Periodontitis (NUP)","ANUG + bone exposure + bone loss.","NO","HIV/immunosuppressed patients."],
["Periodontitis as manifestation of systemic disease","Associated with Papillon-Lefèvre, Chediak-Higashi, diabetes, Down syndrome.","Varies","Treat underlying disease."],
["Pregnancy Gingivitis","Exaggerated response to plaque due to progesterone rise.","YES","Resolves post-partum."],
["Drug-induced Gingival Overgrowth","Gum enlargement from drugs (PCN). Fibrotic, non-painful.","Partial","Drugs: Phenytoin, Ciclosporin, Nifedipine."],
], {
x:0.2, y:0.85, w:9.6, h:4.7,
fontSize:8.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.3, 3.8, 1.1, 2.4],
rowH:0.47,
color: C.darkGray,
autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SLIDE 7 — ANUG & DRUG-INDUCED GINGIVAL OVERGROWTH
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "ANUG and Drug-Induced Gingival Overgrowth", "Two important specific conditions");
// ANUG box (left)
s.addShape(pres.ShapeType.rect, { x:0.2, y:0.9, w:4.6, h:4.5, fill:{color:C.lightGray}, line:{color:C.border, width:0.6} });
s.addText("ACUTE NECROTISING ULCERATIVE GINGIVITIS (ANUG)", { x:0.3, y:0.95, w:4.4, h:0.5, fontSize:10, bold:true, color:C.red, fontFace:"Calibri", wrap:true });
const anugRows = [
[{text:"Diagnostic TRIAD",options:{bold:true}}, "Pain + Punched-out papillae + Bleeding"],
[{text:"Synonyms",options:{bold:true}}, "Trench mouth, Vincent's angina"],
[{text:"Risk factors",options:{bold:true}}, "Stress, smoking, HIV/AIDS, malnutrition, poor oral hygiene"],
[{text:"Pathogens",options:{bold:true}}, "Treponema + Fusobacterium + Selenomonas"],
[{text:"Treatment",options:{bold:true}}, "CHX rinse + Debridement + Metronidazole (if systemic signs)"],
[{text:"Complication",options:{bold:true}}, "Can progress to NUP (bone exposure) if untreated"],
[{text:"Note",options:{bold:true}}, "Onset within 24 hours. The only PAINFUL periodontal condition."],
];
s.addTable(anugRows, {
x:0.3, y:1.5, w:4.4, h:3.7,
fontSize:9, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[1.6, 2.8], rowH:0.5,
color: C.darkGray, autoPage:false,
});
// Drug-induced box (right)
s.addShape(pres.ShapeType.rect, { x:5.1, y:0.9, w:4.7, h:4.5, fill:{color:C.lightGray}, line:{color:C.border, width:0.6} });
s.addText("DRUG-INDUCED GINGIVAL OVERGROWTH", { x:5.2, y:0.95, w:4.5, h:0.5, fontSize:10, bold:true, color:C.accent, fontFace:"Calibri", wrap:true });
const drugRows = [
[{text:"Causative drugs (PCN)",options:{bold:true}}, ""],
["Phenytoin (anti-epileptic)","Most common — affects ~50% of users"],
["Ciclosporin (immunosuppressant)","Organ transplant patients"],
["Nifedipine (Ca-channel blocker)","Cardiac patients"],
[{text:"Features",options:{bold:true}}, "Painless fibrous gum enlargement, starts at interdental papillae"],
[{text:"Treatment",options:{bold:true}}, "Improve oral hygiene + drug substitution + gingivectomy if needed"],
[{text:"Mnemonic",options:{bold:true}}, "\"Please Check Now\" = Phenytoin · Ciclosporin · Nifedipine"],
];
s.addTable(drugRows, {
x:5.2, y:1.5, w:4.5, h:3.7,
fontSize:9, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.3, 2.2], rowH:0.5,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Risk Factors");
// ═══════════════════════════════════════════════════
// SLIDE 8 — RISK FACTORS
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Risk Factors for Periodontal Disease", "Modifiable and non-modifiable factors");
s.addTable([
[
{text:"Risk Factor",options:{bold:true}},
{text:"Category",options:{bold:true}},
{text:"Mechanism / Notes",options:{bold:true}},
],
["Dental plaque / calculus","LOCAL (modifiable)","Primary cause — bacteria trigger inflammation"],
["Smoking / tobacco use","SYSTEMIC (modifiable)","Vasoconstriction masks BOP; impairs healing; doubles risk"],
["Diabetes mellitus (DM)","SYSTEMIC (modifiable)","Bidirectional relationship. Poor glycaemic control worsens disease"],
["HIV / AIDS","SYSTEMIC","Immunosuppression → ANUG, NUP"],
["Genetic susceptibility","NON-MODIFIABLE","IL-1 gene polymorphisms; family history"],
["Medications","SYSTEMIC","Ciclosporin, phenytoin, nifedipine, antidepressants"],
["Hormonal changes","SYSTEMIC (modifiable)","Puberty, pregnancy, menopause — alter tissue response to plaque"],
["Vitamin C deficiency (Scurvy)","NUTRITIONAL (modifiable)","Impaired collagen synthesis → fragile gingiva, bleeding"],
["Xerostomia (dry mouth)","LOCAL","Saliva loss → reduced antimicrobial protection"],
["Systemic diseases","SYSTEMIC","Leukaemia, neutrophil disorders, Papillon-Lefèvre syndrome"],
], {
x:0.2, y:0.85, w:9.6, h:4.65,
fontSize:9.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.8, 2.2, 4.6],
rowH:0.44,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Systemic Links");
// ═══════════════════════════════════════════════════
// SLIDE 9 — SYSTEMIC LINKS
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Systemic Links of Periodontal Disease", "Periodontal infection is NOT just a mouth problem");
para(s, "Bacteria from periodontal pockets enter the bloodstream (bacteraemia) and trigger systemic inflammation through cytokines, LPS, and immune activation.", 0.3, 0.82, 9.4, 0.45);
// Diagram: central circle → radiating conditions
s.addShape(pres.ShapeType.ellipse, { x:3.8, y:1.45, w:2.4, h:1.1, fill:{color:C.accentLt}, line:{color:C.accent, width:1} });
s.addText("Periodontal\nDisease\n(Bacteraemia)", { x:3.8, y:1.45, w:2.4, h:1.1, fontSize:9, bold:true, color:C.accent, align:"center", valign:"middle", fontFace:"Calibri" });
// Radiating boxes
const links = [
{ label:"Cardiovascular Disease\n& Atherosclerosis", x:0.15, y:1.35, note:"Bidirectional" },
{ label:"Diabetes Mellitus", x:0.15, y:2.7, note:"Bidirectional" },
{ label:"Adverse Pregnancy\nOutcomes", x:0.15, y:3.8, note:"Preterm, low birth wt" },
{ label:"Infective Endocarditis", x:7.4, y:1.35, note:"Bacteraemia risk" },
{ label:"Aspiration Pneumonia\n/ Lung Abscess", x:7.4, y:2.7, note:"Oral bacteria aspirated" },
{ label:"Rheumatoid Arthritis", x:7.4, y:3.8, note:"Shared autoimmune path" },
];
links.forEach(l => {
s.addShape(pres.ShapeType.rect, { x:l.x, y:l.y, w:2.8, h:0.75, fill:{color:"F9F9F9"}, line:{color:C.border, width:0.5} });
s.addText(l.label, { x:l.x+0.05, y:l.y+0.04, w:2.7, h:0.45, fontSize:8.5, bold:true, color:C.darkGray, fontFace:"Calibri", valign:"middle", wrap:true });
s.addText(l.note, { x:l.x+0.05, y:l.y+0.5, w:2.7, h:0.22, fontSize:7, italic:true, color:C.gray, fontFace:"Calibri" });
});
// Connecting lines (left side)
[[1.7, 1.74], [1.7, 3.07], [1.7, 4.17]].forEach(([lx, ly]) => {
s.addShape(pres.ShapeType.line, { x:lx, y:ly, w:2.1, h:0, line:{color:C.border, width:0.5} });
});
// Connecting lines (right side)
[[6.2, 1.74], [6.2, 3.07], [6.2, 4.17]].forEach(([lx, ly]) => {
s.addShape(pres.ShapeType.line, { x:lx, y:ly, w:1.2, h:0, line:{color:C.border, width:0.5} });
});
// Brain abscess + Alzheimer's
s.addShape(pres.ShapeType.rect, { x:3.7, y:2.75, w:2.6, h:0.55, fill:{color:"F9F9F9"}, line:{color:C.border, width:0.5} });
s.addText("Brain Abscess / Alzheimer's Disease", { x:3.75, y:2.77, w:2.5, h:0.5, fontSize:8, color:C.darkGray, fontFace:"Calibri", valign:"middle", wrap:true });
noteBox(s, "CRITICAL RULE: Periodontal disease is usually PAINLESS until very late stages or until an abscess forms. This is why patients often don't seek help until teeth are already very loose. Regular check-ups every 6 months are essential.", 0.2, 5.05, 9.6, 0.55, "FFF3CD");
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Diagnosis & Investigations");
// ═══════════════════════════════════════════════════
// SLIDE 10 — DIAGNOSIS
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Diagnosis and Investigations", "Clinical examination + imaging + laboratory");
s.addTable([
[
{text:"Investigation",options:{bold:true}},
{text:"Type",options:{bold:true}},
{text:"What It Detects / Purpose",options:{bold:true}},
{text:"Abnormal Finding",options:{bold:true}},
],
["Periodontal probe","CLINICAL","Measures sulcus / pocket depth in mm","Pocket >3 mm = pathological"],
["Bleeding on probing (BOP)","CLINICAL","Active gingival inflammation","BOP present = inflamed tissue"],
["Gum recession measurement","CLINICAL","How far gum has receded from CEJ","Any recession = attachment loss"],
["Tooth mobility grading","CLINICAL","Degree of tooth loosening (Grade 0–3)","Grade 1+ = bone loss"],
["Furcation involvement","CLINICAL","Bone loss at root fork in multi-rooted teeth","Class I / II / III"],
["Periapical X-ray","RADIOGRAPH","Bone level around individual teeth","Crestal bone loss pattern"],
["Orthopantomogram (OPG)","RADIOGRAPH","Full-mouth overview of bone levels","Generalised bone loss visible"],
["CBCT (Cone Beam CT)","RADIOGRAPH","3D bone architecture — surgical planning","Precise defect shape"],
["Blood tests","LABORATORY","Rule out systemic disease (diabetes, blood dyscrasias)","HbA1c, FBC, ESR"],
], {
x:0.2, y:0.85, w:9.6, h:4.65,
fontSize:9, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.4, 1.5, 3.8, 1.9],
rowH:0.46,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Treatment");
// ═══════════════════════════════════════════════════
// SLIDE 11 — TREATMENT PHASES
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Treatment of Periodontal Disease", "Four-phase approach");
para(s, "Treatment AIM: SLOW or ARREST disease by removing plaque and its by-products. Lost bone CANNOT be fully regrown. Prevention is always better than treatment.", 0.3, 0.82, 9.4, 0.4);
const phases = [
{
ph:"PHASE 1", name:"Systemic Phase", bg:"F2F2F2",
items:["Treat underlying systemic disease (diabetes, blood disorders)","Adjust medications causing gingival overgrowth","Address nutritional deficiencies (Vitamin C)","Smoking cessation counselling"],
},
{
ph:"PHASE 2", name:"Causal / Hygiene Phase", bg:"EAF4FB",
items:["Oral hygiene instruction (brushing technique, flossing)","Supragingival scaling — remove calculus above gumline","Root planing (subgingival scaling) — remove cementum-embedded calculus","Local antibiotics (doxycycline chip) in isolated deep pockets","Review at 6–8 weeks"],
},
{
ph:"PHASE 3", name:"Surgical Phase", bg:"EBF5EB",
items:["Flap surgery (open curettage) — direct access to root surfaces","Guided tissue regeneration (GTR) — attempt bone regeneration","Bone grafts — for specific defects","Implant placement — for lost teeth","Gingivectomy — for gingival overgrowth"],
},
{
ph:"PHASE 4", name:"Maintenance Phase", bg:"FFF8DC",
items:["Supportive periodontal therapy every 3–6 months","Repeat clinical indices (pocket depths, BOP, mobility)","Motivation and re-instruction in oral hygiene","Lifelong commitment — no cure, only control"],
},
];
phases.forEach((p, i) => {
const col = i < 2 ? i * 4.9 + 0.2 : (i - 2) * 4.9 + 0.2;
const ry = i < 2 ? 1.3 : 3.45;
s.addShape(pres.ShapeType.rect, { x:col, y:ry, w:4.6, h:2.0, fill:{color:p.bg}, line:{color:C.border, width:0.6} });
s.addText(`${p.ph} — ${p.name}`, { x:col+0.1, y:ry+0.05, w:4.4, h:0.35, fontSize:9.5, bold:true, color:C.accent, fontFace:"Calibri" });
const arr = p.items.map((t, j) => ({
text: t, options:{ bullet:true, breakLine: j < p.items.length-1, fontSize:8.5, color:C.darkGray, fontFace:"Calibri" }
}));
s.addText(arr, { x:col+0.15, y:ry+0.42, w:4.3, h:1.5, valign:"top" });
});
}
// ═══════════════════════════════════════════════════
// SLIDE 12 — SPECIFIC TREATMENTS (ABSCESS + ANUG)
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Treatment of Specific Conditions", "Periodontal Abscess and ANUG");
// Abscess column
s.addShape(pres.ShapeType.rect, { x:0.2, y:0.85, w:4.5, h:4.65, fill:{color:"F9F9F9"}, line:{color:C.border, width:0.6} });
s.addText("PERIODONTAL ABSCESS", { x:0.3, y:0.9, w:4.3, h:0.35, fontSize:11, bold:true, color:C.red, fontFace:"Calibri" });
s.addTable([
[{text:"Feature",options:{bold:true}}, {text:"Detail",options:{bold:true}}],
["Definition","Acute bacterial infection within an existing periodontal pocket"],
["Presentation","Rapid-onset pain, swelling, pus discharge, tooth tender to bite"],
["Treatment","1. Incision and drainage (I&D)\n2. Subgingival debridement\n3. Antibiotics if systemic spread (Amoxicillin / Metronidazole)\n4. Follow-up definitive periodontal treatment"],
["Distinguish from","Periapical abscess — vitality test differentiates (perio = vital tooth)"],
], {
x:0.3, y:1.3, w:4.3, h:4.1,
fontSize:9, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[1.6, 2.7], rowH:0.7,
color: C.darkGray, autoPage:false,
});
// ANUG column
s.addShape(pres.ShapeType.rect, { x:5.1, y:0.85, w:4.7, h:4.65, fill:{color:"F9F9F9"}, line:{color:C.border, width:0.6} });
s.addText("ANUG TREATMENT", { x:5.2, y:0.9, w:4.5, h:0.35, fontSize:11, bold:true, color:C.red, fontFace:"Calibri" });
s.addTable([
[{text:"Step",options:{bold:true}}, {text:"Action",options:{bold:true}}],
["1","Chlorhexidine (CHX) 0.12% rinse — immediate antimicrobial control"],
["2","Gentle debridement / scaling — do NOT use ultrasonic if very inflamed"],
["3","Metronidazole 200–400 mg TDS × 3–7 days — ONLY if systemic signs (fever, lymphadenopathy)"],
["4","Oral hygiene instruction — gentle technique"],
["5","Nutritional advice — Vitamin C, fluids"],
["6","Stress management + smoking cessation"],
["7","Follow-up in 1–2 weeks — re-assess, complete scaling"],
], {
x:5.2, y:1.3, w:4.5, h:4.1,
fontSize:9, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[0.5, 4.0], rowH:0.51,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SECTION DIVIDER
// ═══════════════════════════════════════════════════
sectionSlide("Prevention");
// ═══════════════════════════════════════════════════
// SLIDE 13 — PREVENTION
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Prevention of Periodontal Disease", "Self-care and professional measures");
s.addTable([
[
{text:"Measure",options:{bold:true}},
{text:"Frequency / Dose",options:{bold:true}},
{text:"Notes",options:{bold:true}},
],
["Tooth brushing","Twice daily — 2 minutes","Use fluoride toothpaste. Modify Bass technique."],
["Flossing / interdental brushes","Once daily","Removes plaque from between teeth — unreachable by toothbrush."],
["Fluoride toothpaste","Every brush","1000–1500 ppm fluoride for adults."],
["Professional scaling & polishing","Every 6 months","Removes calculus. More frequent (3-monthly) for high-risk patients."],
["Smoking cessation","Ongoing","Biggest modifiable risk factor besides plaque."],
["Diabetes control","Ongoing","HbA1c <7%. Periodontal treatment also improves glycaemic control."],
["Chlorhexidine rinse 0.12%","Short-term only (2 weeks max)","Post-surgical or during ANUG. Long-term use causes staining."],
["Electric toothbrush","Twice daily","Superior plaque removal for most patients."],
["High-risk group counselling","At each visit","Pregnant women, diabetics, smokers, immunosuppressed patients."],
], {
x:0.2, y:0.85, w:9.6, h:4.65,
fontSize:9.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.8, 2.1, 4.7],
rowH:0.46,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SLIDE 14 — MNEMONICS & SUMMARY TABLE
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Key Mnemonics and Quick Reference", "Exam-ready facts");
// Mnemonics boxes (top row)
const mnems = [
{ title:"RED COMPLEX", body:"P G T\nPorphyromonas gingivalis\nTannerella forsythia\nTreponema denticola", bg:"FFDDDD" },
{ title:"Drug-induced Gingival\nOvergrowth (PCN)", body:"Please Check Now\nPhenytoin\nCiclosporin\nNifedipine", bg:"D6E4F0" },
{ title:"ANUG TRIAD", body:"PAIN\nPUNCHED-OUT papillae\nBLEEDING\n(+Grey pseudomembrane)", bg:"FFF3CD" },
{ title:"ANUG Treatment", body:"CHX rinse\n+ Debridement\n+ Metronidazole\n(if systemic signs only)", bg:"D4EDDA" },
];
mnems.forEach((m, i) => {
const mx = 0.2 + i * 2.45;
s.addShape(pres.ShapeType.rect, { x:mx, y:0.85, w:2.3, h:2.2, fill:{color:m.bg}, line:{color:C.border, width:0.5} });
s.addText(m.title, { x:mx+0.05, y:0.88, w:2.2, h:0.45, fontSize:9, bold:true, color:C.darkGray, fontFace:"Calibri", align:"center", wrap:true });
s.addShape(pres.ShapeType.line, { x:mx+0.1, y:1.33, w:2.1, h:0, line:{color:C.border, width:0.4} });
s.addText(m.body, { x:mx+0.1, y:1.37, w:2.1, h:1.6, fontSize:9, color:C.darkGray, fontFace:"Calibri", valign:"top", wrap:true });
});
// Comparison table: Gingivitis vs Periodontitis
s.addText("Gingivitis vs. Periodontitis — Key Differences", { x:0.2, y:3.2, w:9.6, h:0.3, fontSize:11, bold:true, color:C.accent, fontFace:"Calibri" });
s.addTable([
[
{text:"Feature",options:{bold:true}},
{text:"Gingivitis",options:{bold:true}},
{text:"Periodontitis",options:{bold:true}},
],
["Bone loss","ABSENT","PRESENT"],
["Attachment loss","ABSENT","PRESENT"],
["Pocket depth",">3 mm? — No (pseudo-pockets only)","True pockets >3 mm"],
["Reversible?","YES — with treatment","NO — bone loss is permanent"],
["Pain","Usually none","Usually none until abscess"],
["Treatment","Scale + oral hygiene","Phases 1–4; possibly surgery"],
], {
x:0.2, y:3.52, w:9.6, h:2.1,
fontSize:9.5, fontFace:"Calibri",
border:{ type:"solid", color:C.border, pt:0.5 },
colW:[2.8, 3.4, 3.4],
rowH:0.3,
color: C.darkGray, autoPage:false,
});
}
// ═══════════════════════════════════════════════════
// SLIDE 15 — SOURCES / REFERENCES
// ═══════════════════════════════════════════════════
{
const s = pres.addSlide();
addTitle(s, "Sources and References", "");
bullet(s, [
"Scott-Brown's Otorhinolaryngology, Head & Neck Surgery",
"Robbins & Cotran Pathologic Basis of Disease",
"Tintinalli's Emergency Medicine: A Comprehensive Study Guide",
"Harrison's Principles of Internal Medicine, 22nd Edition",
"Junqueira's Basic Histology: Text and Atlas",
"Sherris Medical Microbiology",
"Compiled by Orris Medical Library",
], 0.5, 0.95, 9, 4.5, { fontSize:13 });
noteBox(s, "Note: Burket's Oral Medicine is not available in this library — concepts covered are identical to what Burket's covers.", 0.5, 5.0, 9, 0.42, C.lightGray);
}
// ─── WRITE FILE ───
pres.writeFile({ fileName: "/home/daytona/workspace/perio-pptx/Periodontal_Disease.pptx" })
.then(() => console.log("DONE: /home/daytona/workspace/perio-pptx/Periodontal_Disease.pptx"))
.catch(e => { console.error(e); process.exit(1); });
cd /home/daytona/workspace/perio-pptx && node build.js
ls -lh /home/daytona/workspace/perio-pptx/Periodontal_Disease.pptx
Periodontal Disease
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide — with the fence-post analogy box |
| 2 | Anatomy of the Periodontium — labelled diagram (gingiva, PDL, cementum, alveolar bone) + comparison table |
| 3 | Dental Plaque & Calculus — progression flow diagram + supragingival vs. subgingival plaque table |
| 4 | Key Periodontal Pathogens — full table: Red Complex, Aggressive group, ANUG organisms |
| 5 | Pathogenesis — 5-stage progression diagram (Healthy → Severe) + mechanism-of-destruction table |
| 6 | Classification Table — all 9 disease types with reversibility and key notes |
| 7 | ANUG & Drug-induced Gingival Overgrowth — side-by-side detail tables |
| 8 | Risk Factors — modifiable vs. non-modifiable table with mechanisms |
| 9 | Systemic Links — hub-and-spoke diagram (CV disease, diabetes, pregnancy, RA, Alzheimer's, endocarditis) |
| 10 | Diagnosis & Investigations — clinical, radiographic, and laboratory table |
| 11 | 4-Phase Treatment — phase boxes (Systemic / Hygiene / Surgical / Maintenance) |
| 12 | Periodontal Abscess + ANUG Treatment — two-column detail tables |
| 13 | Prevention — frequency and dosing table |
| 14 | Mnemonics — Red Complex (PGT), PCN drugs, ANUG triad + Gingivitis vs. Periodontitis comparison table |
| 15 | References — all source textbooks |