Do you make pdf?

Yes! I can work with PDFs in several ways:
Reading & Extracting
  • Extract text, tables, or images from existing PDFs
  • OCR scanned PDFs to make them searchable
  • Read and summarize PDF content
Creating & Editing
  • Create new PDFs from scratch
  • Merge multiple PDFs into one
  • Split a PDF into separate files
  • Rotate pages, add watermarks
  • Fill PDF forms
  • Encrypt/decrypt PDFs
Converting
  • Convert content (text, data, markdown) into a PDF
Just tell me what you'd like to do - share a PDF file or describe what you need, and I'll get started!

Here make me a note type pdf on those topic

Reading File
Running Command

ls -la /tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/

Running Command

python3 << 'EOF' import pdfplumber with pdfplumber.open("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") as pdf: print(f"Total pages: {len(pdf.pages)}") # Extract first few pages to understand topics for i, page in enumerate(pdf.pages[:10]): text = page.extract_text() if text: print(f"\n--- PAGE {i+1} ---") print(text[:1000]) EOF

Running Command

python3 << 'EOF' from pypdf import PdfReader import pdfplumber # Try pypdf extraction reader = PdfReader("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") print(f"Pages: {len(reader.pages)}") for i, page in enumerate(reader.pages[:5]): text = page.extract_text() print(f"\n--- PAGE {i+1} ---") print(repr(text[:500]) if text else "NO TEXT") # Check if there are any images with pdfplumber.open("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") as pdf: page0 = pdf.pages[0] print("\nPage 0 objects:", dir(page0)) print("Images on page 0:", len(page0.images)) print("Chars count:", len(page0.chars)) EOF

Running Command

python3 << 'EOF' import pdfplumber from PIL import Image import io, os os.makedirs("/tmp/workspace/pdf_pages", exist_ok=True) with pdfplumber.open("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") as pdf: for i, page in enumerate(pdf.pages): img = page.to_image(resolution=150) img.save(f"/tmp/workspace/pdf_pages/page_{i+1:02d}.png") print(f"Saved page {i+1}") print("Done!") EOF

Running Command

python3 << 'EOF' from PIL import Image import os # Combine pages into groups for efficient analysis groups = { "group1": list(range(1, 5)), # pages 1-4 "group2": list(range(5, 9)), # pages 5-8 "group3": list(range(9, 13)), # pages 9-12 "group4": list(range(13, 18)), # pages 13-17 } for gname, pages in groups.items(): imgs = [] for p in pages: img = Image.open(f"/tmp/workspace/pdf_pages/page_{p:02d}.png") imgs.append(img) # Stack vertically total_height = sum(im.height for im in imgs) max_width = max(im.width for im in imgs) combined = Image.new("RGB", (max_width, total_height), "white") y = 0 for im in imgs: combined.paste(im, (0, y)) y += im.height out_path = f"/tmp/workspace/pdf_pages/{gname}.png" combined.save(out_path) size = os.path.getsize(out_path) print(f"{gname}: {len(pages)} pages, {total_height}px tall, {size/1024:.0f} KB") print("Done combining!") EOF

Running Command

python3 << 'EOF' # Convert to smaller resolution for upload and use base64 approach # Actually - let me check if there's a way to host these as file:// URLs # The analyse_media tool needs HTTP URLs. Let me start a simple HTTP server. import subprocess, os # Check current directory print(os.getcwd()) # List the pages for f in sorted(os.listdir("/tmp/workspace/pdf_pages")): size = os.path.getsize(f"/tmp/workspace/pdf_pages/{f}") print(f"{f}: {size/1024:.0f} KB") EOF

Running Command

# Start a simple HTTP server to serve the images cd /tmp/workspace/pdf_pages && python3 -m http.server 8765 & sleep 2 echo "Server started" # Test it curl -s -I http://localhost:8765/page_01.png | head -5

analyse_media
analyse_media
analyse_media
analyse_media
Running Command

python3 << 'EOF' # Try pytesseract OCR try: import pytesseract from PIL import Image img = Image.open("/tmp/workspace/pdf_pages/page_01.png") text = pytesseract.image_to_string(img) print("OCR SUCCESS:") print(text[:2000]) except ImportError as e: print(f"pytesseract not available: {e}") # Try easyocr try: import easyocr print("easyocr available") except ImportError: print("easyocr not available either") # Try pdf2image try: import pdf2image print("pdf2image available") except: print("pdf2image not available") EOF

Running Command

python3 -c "import pytesseract" 2>&1 || pip install --user pytesseract 2>&1 | tail -5

Running Command

python3 << 'EOF' import pytesseract from PIL import Image # Test OCR on page 1 img = Image.open("/tmp/workspace/pdf_pages/page_01.png") text = pytesseract.image_to_string(img) print("PAGE 1 OCR:") print(text[:3000]) EOF

Loading Image
analyse_media
Running Command

python3 << 'EOF' # Try markitdown try: from markitdown import MarkItDown md = MarkItDown() result = md.convert("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") print("MARKITDOWN RESULT:") print(result.text_content[:5000]) except Exception as e: print(f"markitdown error: {e}") # Try checking the raw PDF bytes for embedded text from pypdf import PdfReader reader = PdfReader("/tmp/workspace/attachments/3ab17b76-0300-4017-88d4-d2a06f01893a/Multiple.pdf") print(f"\nMetadata: {reader.metadata}") print(f"Pages: {len(reader.pages)}") # Check if there's any /Annots or form data for i, page in enumerate(reader.pages): raw = page.get_object() keys = list(raw.keys()) if hasattr(raw, 'keys') else [] print(f"Page {i+1} keys: {keys[:10]}") if i > 2: break EOF

Reading File
Reading File
Reading File
Reading File
Running Command

python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm, mm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, KeepTogether from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY from reportlab.platypus import PageBreak import os os.makedirs("/tmp/workspace/notes_output", exist_ok=True) doc = SimpleDocTemplate( "/tmp/workspace/notes_output/Chapter17_Notes.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2.5*cm, bottomMargin=2.5*cm ) # Color palette DARK_BLUE = colors.HexColor("#1a3c6e") MED_BLUE = colors.HexColor("#2563a8") LIGHT_BLUE = colors.HexColor("#dbeafe") ACCENT_RED = colors.HexColor("#b91c1c") ACCENT_GOLD = colors.HexColor("#b45309") GREEN = colors.HexColor("#15803d") LIGHT_GREEN = colors.HexColor("#dcfce7") YELLOW_BG = colors.HexColor("#fef9c3") ORANGE = colors.HexColor("#c2410c") GREY_BG = colors.HexColor("#f1f5f9") BORDER_GREY = colors.HexColor("#cbd5e1") WHITE = colors.white BLACK = colors.black styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, **kw) # Define custom styles ch_title = S("ChTitle", fontName="Helvetica-Bold", fontSize=20, textColor=WHITE, alignment=TA_CENTER, spaceAfter=4) ch_sub = S("ChSub", fontName="Helvetica", fontSize=13, textColor=WHITE, alignment=TA_CENTER) h1 = S("H1", fontName="Helvetica-Bold", fontSize=13, textColor=WHITE, alignment=TA_LEFT, spaceBefore=4, spaceAfter=2, leftPadding=8) h2 = S("H2", fontName="Helvetica-Bold", fontSize=11, textColor=DARK_BLUE, spaceBefore=8, spaceAfter=3) h3 = S("H3", fontName="Helvetica-Bold", fontSize=10, textColor=ACCENT_RED, spaceBefore=5, spaceAfter=2) body = S("Body", fontName="Helvetica", fontSize=9.5, leading=14, textColor=BLACK, spaceAfter=3, alignment=TA_JUSTIFY) bullet = S("Bullet", fontName="Helvetica", fontSize=9.5, leading=13, textColor=BLACK, leftIndent=14, spaceAfter=2, bulletIndent=4) bullet2 = S("Bullet2", fontName="Helvetica", fontSize=9, leading=12, textColor=colors.HexColor("#374151"), leftIndent=26, spaceAfter=1.5, bulletIndent=14) bold_body = S("BoldBody", fontName="Helvetica-Bold", fontSize=9.5, leading=14, textColor=DARK_BLUE, spaceAfter=2) note_style = S("Note", fontName="Helvetica-Oblique", fontSize=9, leading=13, textColor=ACCENT_GOLD, leftIndent=10, spaceAfter=2) imp = S("Imp", fontName="Helvetica-Bold", fontSize=9.5, textColor=ACCENT_RED, spaceAfter=2) def section_header(text, color=DARK_BLUE): data = [[Paragraph(text, h1)]] t = Table(data, colWidths=[doc.width]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), color), ("ROWPADDING", (0,0), (-1,-1), 6), ("LEFTPADDING", (0,0), (-1,-1), 10), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("BOX", (0,0), (-1,-1), 0, color), ])) return t def highlight_box(text, bg=YELLOW_BG, border=ACCENT_GOLD): data = [[Paragraph(text, S("hb", fontName="Helvetica-Bold", fontSize=9.5, textColor=ACCENT_GOLD, leading=14))]] t = Table(data, colWidths=[doc.width]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("BOX", (0,0), (-1,-1), 1, border), ("ROWPADDING", (0,0), (-1,-1), 6), ("LEFTPADDING", (0,0), (-1,-1), 10), ])) return t def info_box(text, bg=LIGHT_BLUE, border=MED_BLUE): data = [[Paragraph(text, S("ib", fontName="Helvetica", fontSize=9.5, textColor=DARK_BLUE, leading=14))]] t = Table(data, colWidths=[doc.width]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("BOX", (0,0), (-1,-1), 1, border), ("ROWPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 10), ])) return t def green_box(text): data = [[Paragraph(text, S("gb", fontName="Helvetica", fontSize=9.5, textColor=GREEN, leading=14))]] t = Table(data, colWidths=[doc.width]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), LIGHT_GREEN), ("BOX", (0,0), (-1,-1), 1, GREEN), ("ROWPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 10), ])) return t def sp(n=6): return Spacer(1, n) def hr(): return HRFlowable(width="100%", thickness=0.5, color=BORDER_GREY, spaceAfter=4, spaceBefore=4) def B(txt): return f"<b>{txt}</b>" def I(txt): return f"<i>{txt}</i>" def C(txt, col): return f'<font color="{col}">{txt}</font>' story = [] # ───────────────────────────────────────────── # COVER / TITLE PAGE # ───────────────────────────────────────────── cover_data = [[ Paragraph("CHAPTER 17", S("ct1", fontName="Helvetica-Bold", fontSize=11, textColor=LIGHT_BLUE, alignment=TA_CENTER)), Paragraph("Multiple Pregnancy, Amniotic Fluid Disorders,<br/>Abnormalities of Placenta and Cord", S("ct2", fontName="Helvetica-Bold", fontSize=17, textColor=WHITE, alignment=TA_CENTER, leading=24)), Paragraph("DC Dutta's Obstetrics — 10th Edition", S("ct3", fontName="Helvetica-Oblique", fontSize=10, textColor=LIGHT_BLUE, alignment=TA_CENTER)), Paragraph("Study Notes", S("ct4", fontName="Helvetica", fontSize=10, textColor=colors.HexColor("#94a3b8"), alignment=TA_CENTER)), ]] cover_tbl = Table([[cover_data[0][0]], [cover_data[0][1]], [sp(6)], [cover_data[0][2]], [cover_data[0][3]]], colWidths=[doc.width]) cover_tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE), ("TOPPADDING", (0,0), (-1,-1), 10), ("BOTTOMPADDING", (0,0), (-1,-1), 10), ("LEFTPADDING", (0,0), (-1,-1), 20), ("RIGHTPADDING", (0,0), (-1,-1), 20), ])) story.append(cover_tbl) story.append(sp(14)) # Chapter Outline box outline_items = [ "Twins: Diagnosis, Complications, Prognosis, Complications of Monochorionic Twins", "Antenatal Management", "Management during Labour", "Triplets, Quadruplets, etc.", "Amniotic Fluid Disorders: Polyhydramnios (Aetiology, Chronic Polyhydramnios, Complications)", "Management of Hydramnios, Acute Polyhydramnios, Oligohydramnios", "Abnormalities of Placenta and Cord: Placental Abnormalities, Cord Abnormalities", ] outline_text = "<b>Chapter Outline</b><br/><br/>" + "<br/>".join(f"• {x}" for x in outline_items) story.append(info_box(outline_text)) story.append(sp(12)) # ───────────────────────────────────────────── # SECTION 1: TWINS # ───────────────────────────────────────────── story.append(section_header("1. TWINS", DARK_BLUE)) story.append(sp(6)) story.append(Paragraph("<b>Definition:</b> When more than one fetus simultaneously develops in the uterus, it is called <b>multiple pregnancy</b>. Simultaneous development of two fetuses (twins) is the most common.", body)) story.append(sp(4)) story.append(Paragraph("VARIETIES OF TWINS", h2)) tbl_data = [ [Paragraph("<b>Feature</b>", bold_body), Paragraph("<b>Dizygotic (DZ) — 80%</b>", bold_body), Paragraph("<b>Monozygotic (MZ) — 20%</b>", bold_body)], [Paragraph("Synonym", body), Paragraph("Fraternal / binovular", body), Paragraph("Identical / uniovular", body)], [Paragraph("Origin", body), Paragraph("Fertilization of two ova by two sperms during a single ovarian cycle", body), Paragraph("Cleavage of a single fertilized ovum", body)], [Paragraph("Placenta", body), Paragraph("Two (separate or fused)", body), Paragraph("Single", body)], [Paragraph("Intervening membranes", body), Paragraph("4 layers (amnion+chorion+chorion+amnion) >2 mm", body), Paragraph("2 layers (amnion only) <2 mm", body)], [Paragraph("Sex", body), Paragraph("May differ", body), Paragraph("Always identical", body)], [Paragraph("Genetics", body), Paragraph("Differ (like brothers/sisters from different births)", body), Paragraph("Same", body)], [Paragraph("Frequency", body), Paragraph("More common; responsible for wide variation in incidence", body), Paragraph("Constant worldwide (~1 in 250)", body)], ] t = Table(tbl_data, colWidths=[3.5*cm, 7.2*cm, 7.2*cm]) t.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), DARK_BLUE), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREY_BG]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("RIGHTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(t) story.append(sp(8)) # Chorionicity table story.append(Paragraph("DETERMINATION OF CHORIONICITY (Timing of Cleavage)", h2)) chorio_data = [ [Paragraph("<b>Timing of Cleavage</b>", bold_body), Paragraph("<b>Placenta's Membrane Status</b>", bold_body), Paragraph("<b>% of Mono-zygotic Twins</b>", bold_body)], [Paragraph("<72 hrs (before diff. of inner cell mass)", body), Paragraph("Diamniotic-Dichorionic (D/D)", body), Paragraph("25–30%", body)], [Paragraph("Days 4–7 (at time of diff. of inner cell mass)", body), Paragraph("Diamniotic-Monochorionic (D/M)", body), Paragraph("70–75%", body)], [Paragraph("Days 8–12 (when amnion is established)", body), Paragraph("Monoamniotic-Monochorionic (M/M)", body), Paragraph("1–2%", body)], [Paragraph("Day >13", body), Paragraph("Conjoined (Siamese)", body), Paragraph("<1%", body)], ] tc = Table(chorio_data, colWidths=[6*cm, 7*cm, 4.9*cm]) tc.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), MED_BLUE), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_BLUE]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(tc) story.append(sp(6)) story.append(info_box("🔑 <b>Key Concept:</b> Chorionicity is determined by the <b>timing of embryo division</b> and is a more important determinant of adverse outcome than zygosity. Best diagnosed by TVS at <b>11–14 weeks</b>.")) story.append(sp(8)) # Incidence story.append(Paragraph("INCIDENCE", h2)) incidence_data = [ [Paragraph("<b>Country/Region</b>", bold_body), Paragraph("<b>Incidence</b>", bold_body)], [Paragraph("Nigeria (highest)", body), Paragraph("1 in 20", body)], [Paragraph("Japan (lowest)", body), Paragraph("1 in 250", body)], [Paragraph("India", body), Paragraph("1 in 80", body)], [Paragraph("General (Hellin's rule)", body), Paragraph("Twins: 1/80; Triplets: 1/80²; Quadruplets: 1/80³", body)], ] ti = Table(incidence_data, colWidths=[8*cm, 9.9*cm]) ti.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), ACCENT_GOLD), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, YELLOW_BG]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ])) story.append(ti) story.append(sp(8)) # Risk Factors for DZ Twins story.append(Paragraph("RISK FACTORS FOR DIZYGOTIC TWINS", h2)) rf_items = [ ("<b>Race:</b>", "Highest in Africa (Nigeria), lowest in eastern countries. Intermediate in Caucasians."), ("<b>Family History:</b>", "Hereditary predisposition transmitted through the <b>female (maternal) side</b>. DZ twins are increased."), ("<b>Advanced Maternal Age:</b>", "Incidence increases with age; maximum between <b>30–35 years</b>."), ("<b>ART Procedures:</b>", "Gonadotropin therapy: 12–15%; Clomiphene citrate: 7–9%; Letrozole: ~5%. Recently declining due to single embryo transfer policies."), ("<b>Parity:</b>", "Incidence increases from fifth gravida onward."), ] for bold_part, rest in rf_items: story.append(Paragraph(f"• {bold_part} {rest}", bullet)) story.append(sp(6)) # Other special conditions story.append(Paragraph("SPECIAL CONDITIONS IN MULTIPLE GESTATION", h2)) special = [ ("<b>Superfecundation:</b>", "Fertilization of two different ova released in the same cycle, by separate acts of coitus within a short period of time."), ("<b>Superfetation:</b>", "Fertilization of two ova released in different menstrual cycles. One fetus develops over another; possible until 12 weeks (before decidual space obliteration)."), ("<b>Fetus Papyraceus / Compressus:</b>", "One fetus dies early. Dead fetus is flattened, mummified, compressed between membranes. More common in <b>monozygotic twins</b>. Discovered at delivery or by sonography."), ("<b>Fetus Acardiacus:</b>", "Occurs only in <b>monozygotic twins</b>. Part of one fetus remains amorphous and becomes parasitic without a heart."), ("<b>Hydatidiform Mole (from one placenta):</b>", "A normal fetus and placenta from the other conceptus coexist — seen ultrasonographically."), ("<b>Vanishing Twin:</b>", "Serial US in early pregnancy occasionally reveals death of one fetus and continuation of pregnancy with the surviving one. Dead fetus (within 14 weeks) is simply 'vanished' by resorption. Rate of disappearance can be up to 40%."), ] for bold_part, rest in special: story.append(Paragraph(f"• {bold_part} {rest}", bullet)) story.append(sp(6)) # Maternal physiological changes story.append(Paragraph("MATERNAL PHYSIOLOGICAL CHANGES", h2)) phys = [ "Increase in <b>weight gain</b> and cardiac output", "Plasma volume increased by an addition of <b>500 mL</b>; no corresponding increase in red cell volume → exaggerated hemodilution and anemia", "Increased <b>alpha-fetoprotein level</b>, tidal volume, and glomerular filtration rate", ] for p in phys: story.append(Paragraph(f"• {p}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 2: DIAGNOSIS # ───────────────────────────────────────────── story.append(section_header("2. DIAGNOSIS OF TWINS", MED_BLUE)) story.append(sp(6)) story.append(Paragraph("HISTORY", h2)) story.append(Paragraph("• History of <b>ovulation-inducing drugs</b> (especially gonadotropins, for infertility or ART use)", bullet)) story.append(Paragraph("• <b>Family history</b> of twinning (more often present in the maternal side)", bullet)) story.append(sp(4)) story.append(Paragraph("SYMPTOMS", h2)) symp = [ "Increased <b>nausea and vomiting</b> in early months", "<b>Cardiorespiratory embarrassment</b> (palpitation, shortness of breath) in later months", "<b>Swelling of legs</b>, varicose veins, hemorrhoids greater", "Unusual rate of <b>abdominal enlargement</b> and excessive fetal movements", ] for s in symp: story.append(Paragraph(f"• {s}", bullet)) story.append(sp(4)) story.append(Paragraph("GENERAL EXAMINATION", h2)) ge = [ "Prevalence of <b>anemia</b> more than in singleton", "Unusual <b>weight gain</b>, not explained by preeclampsia or obesity — important feature", "Evidence of <b>preeclampsia (25%)</b> is a common association", ] for g in ge: story.append(Paragraph(f"• {g}", bullet)) story.append(sp(4)) story.append(Paragraph("ABDOMINAL EXAMINATION", h2)) story.append(Paragraph("<b>Inspection:</b>", bold_body)) story.append(Paragraph("• Elongated uterus changed to a <b>'barrel shape'</b>; abdomen unduly enlarged", bullet)) story.append(Paragraph("<b>Palpation:</b>", bold_body)) palp = [ "Height of uterus <b>more than period of amenorrhea</b>; discrepancy evident from midpregnancy", "Girth of abdomen at umbilicus <b>>100 cm</b> at term", "<b>Fetal bulk seems disproportionately larger</b> in relation to size of fetal head", "Palpation of <b>too many fetal parts</b>", "Finding of <b>two fetal heads</b> or <b>three fetal poles</b> makes clinical diagnosis almost certain", ] for p in palp: story.append(Paragraph(f" – {p}", bullet2)) story.append(Paragraph("<b>Auscultation:</b>", bold_body)) story.append(Paragraph("• Simultaneous auscultation of <b>two distinct FHSs at separate spots with a silent area in between</b> by two observers", bullet)) story.append(Paragraph(" – Difference in heart rates must be <b>at least 10 beats/min</b>", bullet2)) story.append(sp(4)) story.append(Paragraph("INVESTIGATIONS", h2)) inv = [ "<b>Sonography (key):</b> Confirmation from 10th week; viability; vanishing twin (2nd trimester); chorionicity (lambda/twin peak sign = dichorionic; T-sign = monochorionic); pregnancy dating; fetal anomalies; IUGR monitoring every 3–4 weeks; presentation; twin transfusion (Doppler); placental localization; amniotic fluid volume", ] for i in inv: story.append(Paragraph(f"• {i}", bullet)) story.append(sp(4)) story.append(highlight_box("CHORIONICITY SIGNS ON ULTRASOUND:\n• Dichorionic: <b>Twin peak sign (Lambda sign)</b> — thick septum >2 mm, chorion + amnion each side, proliferating placental villi fill potential space\n• Monochorionic: <b>T-sign</b> — thin intertwin membrane <2 mm, 2 layers (amnion only), no chorion")) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 3: PRESENTATIONS / LIE # ───────────────────────────────────────────── story.append(section_header("3. LIE AND PRESENTATION IN TWINS", colors.HexColor("#4f46e5"))) story.append(sp(6)) pres_data = [ [Paragraph("<b>Presentation</b>", bold_body), Paragraph("<b>Frequency</b>", bold_body)], [Paragraph("Both vertex", body), Paragraph("50%", body)], [Paragraph("1st vertex, 2nd breech", body), Paragraph("30%", body)], [Paragraph("1st breech, 2nd vertex", body), Paragraph("10%", body)], [Paragraph("Both breech", body), Paragraph("10%", body)], [Paragraph("1st vertex, 2nd transverse (rarest — rule out conjoined twins)", body), Paragraph("Rare", body)], ] tp = Table(pres_data, colWidths=[11*cm, 6.9*cm]) tp.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#4f46e5")), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, colors.HexColor("#ede9fe")]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ])) story.append(tp) story.append(sp(6)) story.append(info_box("⚠️ <b>Most common lie:</b> Longitudinal in 90%. <b>Both transverse</b> is the rarest and when present, conjoined twins must be ruled out.")) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 4: COMPLICATIONS OF TWINS # ───────────────────────────────────────────── story.append(section_header("4. COMPLICATIONS OF TWINS", ACCENT_RED)) story.append(sp(6)) story.append(Paragraph("MATERNAL COMPLICATIONS", h2)) mat_comp = [ "Anemia (common due to exaggerated hemodilution)", "Preeclampsia (25%)", "Polyhydramnios", "Preterm labour — most important complication", "Malpresentations", "Antepartum/Postpartum hemorrhage", "Operative delivery increased", "Puerperal sepsis", ] for mc in mat_comp: story.append(Paragraph(f"• {mc}", bullet)) story.append(sp(4)) story.append(Paragraph("FETAL/NEONATAL COMPLICATIONS", h2)) fet_comp = [ "Preterm birth — leading cause of perinatal morbidity/mortality", "IUGR — more common in monochorionic", "Congenital malformations — 2× more common than singletons", "Perinatal mortality — 3–4× higher than singletons", "Twin-to-Twin Transfusion Syndrome (TTTS)", "Cord prolapse, cord entanglement", "Locked twins (rare)", "Fetus papyraceus, fetus acardiacus", ] for fc in fet_comp: story.append(Paragraph(f"• {fc}", bullet)) story.append(sp(6)) story.append(Paragraph("COMPLICATIONS OF MONOCHORIONIC TWINS", h3)) mc_comp = [ "<b>Twin-to-Twin Transfusion Syndrome (TTTS):</b> Arteriovenous anastomosis; donor twin (small, anemic, oligohydramnios) vs recipient twin (larger, polycythemic, polyhydramnios). Treated by laser photocoagulation of communicating vessels", "<b>Twin Reversed Arterial Perfusion (TRAP) / Fetus Acardiacus:</b> One twin becomes acardiac and parasitic", "<b>Monoamniotic-Monochorionic (M/M) twins:</b> Cord entanglement — most dangerous complication", "<b>Intrauterine death of one twin:</b> Risk to surviving twin (DIC, neurological damage)", "<b>Conjoined (Siamese) Twins:</b> Thoracopagus (most common), pyopagus (posterior), craniopagus, ischiopagus", ] for mc in mc_comp: story.append(Paragraph(f"• {mc}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 5: ANTENATAL MANAGEMENT # ───────────────────────────────────────────── story.append(section_header("5. ANTENATAL MANAGEMENT", colors.HexColor("#0f766e"))) story.append(sp(6)) antenatal = [ "Early confirmation by <b>ultrasonography</b>; determine chorionicity at 11–14 weeks", "<b>Increased dietary supplementation:</b> Iron, folic acid, calcium; high-calorie diet", "<b>Rest:</b> Adequate rest; avoid strenuous activity from 28 weeks", "<b>Cervical length monitoring</b> for preterm prediction", "<b>Serial growth scans:</b> Every 3–4 weeks for IUGR", "<b>Doppler studies</b> for TTTS surveillance in monochorionic twins", "<b>Hospitalization</b> from 28–32 weeks in high-risk cases", "Corticosteroids for fetal lung maturity if preterm risk", "Planned delivery at <b>36–38 weeks</b> for uncomplicated twins", ] for a in antenatal: story.append(Paragraph(f"• {a}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 6: MANAGEMENT DURING LABOUR # ───────────────────────────────────────────── story.append(section_header("6. MANAGEMENT DURING LABOUR", colors.HexColor("#0f766e"))) story.append(sp(6)) labour = [ "Set up IV line; blood cross-match available", "Continuous CTG monitoring of <b>both fetuses</b>", "Consultant obstetrician and neonatologist present", "Delivery of <b>1st twin:</b> As per presentation (vertex — SVD or LSCS if indicated)", "After 1st twin delivery: Re-assess lie/presentation of 2nd twin by palpation and USG", "Oxytocin infusion to maintain contractions; aim to deliver <b>2nd twin within 30 min</b>", "Delivery of <b>2nd twin:</b> Vertex — ARM + oxytocin; Breech — assisted breech; Transverse — ECV → vertex; if fails → internal podalic version (IPV) + breech extraction", "Active management of 3rd stage — <b>high risk of PPH</b> due to overdistended uterus", "Epidural analgesia preferred for pain relief and instrumental delivery", "<b>LSCS indications:</b> 1st twin breech, monoamniotic twins, conjoined twins, TTTS, fetal distress, failed progress", ] for l in labour: story.append(Paragraph(f"• {l}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 7: TRIPLETS / HIGHER ORDER # ───────────────────────────────────────────── story.append(section_header("7. TRIPLETS, QUADRUPLETS, ETC.", DARK_BLUE)) story.append(sp(6)) story.append(Paragraph( "Higher order multiple pregnancies (HOMs) have increased dramatically with ART. " "All risks are multiplied. Management includes:", body)) story.append(sp(4)) hom = [ "Early first-trimester chorionicity mapping", "<b>Multifetal pregnancy reduction (MFPR):</b> Usually to twins; performed at 11–14 weeks by intracardiac KCl injection under USG guidance; reduces perinatal mortality and morbidity", "Intensive antenatal surveillance", "Planned LSCS in most cases", "Preterm birth almost universal — aggressive tocolysis and corticosteroids", "Cervical cerclage considered in selected cases", ] for h in hom: story.append(Paragraph(f"• {h}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 8: AMNIOTIC FLUID DISORDERS # ───────────────────────────────────────────── story.append(section_header("8. AMNIOTIC FLUID DISORDERS", colors.HexColor("#7c3aed"))) story.append(sp(6)) story.append(Paragraph("POLYHYDRAMNIOS (HYDRAMNIOS)", h2)) story.append(Paragraph( "<b>Definition:</b> Excessive accumulation of amniotic fluid — " "AFI <b>>24 cm</b> or deepest vertical pocket (DVP) <b>>8 cm</b>.", body)) story.append(sp(4)) story.append(Paragraph("ETIOLOGY (Mnemonic: Fluid accumulates from impaired fetal swallowing or excess production)", h3)) etio_data = [ [Paragraph("<b>Fetal Causes (~25%)</b>", bold_body), Paragraph("<b>Maternal Causes (~25%)</b>", bold_body), Paragraph("<b>Idiopathic (~50%)</b>", bold_body)], [Paragraph("• Anencephaly, spina bifida (↓swallowing)\n• Esophageal/duodenal atresia\n• Diaphragmatic hernia\n• Fetal hydrops\n• Neuromuscular disorders", body), Paragraph("• Diabetes mellitus (most common maternal cause)\n• Rhesus isoimmunization\n• Multiple pregnancy (especially TTTS)\n• Liver disease", body), Paragraph("• No identifiable cause in ~50% cases (chronic, mild to moderate)", body)], ] te = Table(etio_data, colWidths=[6.3*cm, 6.3*cm, 5.3*cm]) te.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), colors.HexColor("#7c3aed")), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [colors.HexColor("#f3e8ff")]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(te) story.append(sp(6)) story.append(Paragraph("CHRONIC POLYHYDRAMNIOS", h3)) chronic = [ "Most common type; gradual onset after 30 weeks", "Abdomen greatly distended; skin tense, shiny, striae present", "Umbilicus flattened or everted", "FHS difficult to hear; fetal parts hard to palpate", "USG confirms: AFI >24 cm", ] for c in chronic: story.append(Paragraph(f"• {c}", bullet)) story.append(sp(4)) story.append(Paragraph("ACUTE POLYHYDRAMNIOS", h3)) acute = [ "Rare; sudden onset, usually at 20–24 weeks (associated with MZ twins)", "Rapid uterine distension causes severe discomfort, dyspnea, edema", "Emergency therapeutic amniocentesis/amnioreduction often required", ] for a in acute: story.append(Paragraph(f"• {a}", bullet)) story.append(sp(4)) story.append(Paragraph("COMPLICATIONS OF POLYHYDRAMNIOS", h3)) polyhcomp = [ "Maternal: Dyspnea, edema, varicosities; preterm labour", "Malpresentation and unstable lie", "PROM (premature rupture of membranes)", "Cord prolapse on rupture of membranes", "Placental abruption (sudden decompression)", "PPH (uterine overdistension → atony)", "Perinatal mortality increased due to associated anomalies", ] for p in polyhcomp: story.append(Paragraph(f"• {p}", bullet)) story.append(sp(6)) story.append(Paragraph("MANAGEMENT OF POLYHYDRAMNIOS", h2)) polyh_mgmt = [ "Identify and treat underlying cause (diabetes, Rh isoimmunization)", "<b>Conservative:</b> Rest, diuretics (limited use), indomethacin (↓fetal urine output; used before 32 weeks)", "<b>Therapeutic amniocentesis (amnioreduction):</b> For severe cases with distress; 1–2 L removed slowly; can be repeated", "<b>Delivery:</b> Controlled ARM (artificial rupture of membranes) — release fluid slowly with finger over os to prevent cord prolapse or placental abruption", "Treat underlying fetal anomaly if amenable (e.g., laser for TTTS)", ] for p in polyh_mgmt: story.append(Paragraph(f"• {p}", bullet)) story.append(sp(8)) story.append(Paragraph("OLIGOHYDRAMNIOS", h2)) story.append(Paragraph( "<b>Definition:</b> Deficient amniotic fluid — AFI <b><5 cm</b> or DVP <b><2 cm</b>.", body)) story.append(sp(4)) oligo_data = [ [Paragraph("<b>Causes</b>", bold_body), Paragraph("<b>Details</b>", bold_body)], [Paragraph("Fetal renal anomalies", body), Paragraph("Renal agenesis (Potter sequence), polycystic kidneys, obstruction of urinary tract (most common structural cause)", body)], [Paragraph("IUGR / Uteroplacental insufficiency", body), Paragraph("Fetal kidneys hypoperfused → decreased urine output → oligohydramnios", body)], [Paragraph("Post-term pregnancy", body), Paragraph("Placental insufficiency; AFI <5 cm is an indication for delivery", body)], [Paragraph("PPROM", body), Paragraph("Amniotic fluid leaks; most common cause in 2nd trimester", body)], [Paragraph("Drugs", body), Paragraph("Indomethacin, ACE inhibitors (in 2nd/3rd trimester)", body)], ] to = Table(oligo_data, colWidths=[5*cm, 12.9*cm]) to.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), ACCENT_RED), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, colors.HexColor("#fee2e2")]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(to) story.append(sp(4)) story.append(Paragraph("COMPLICATIONS OF OLIGOHYDRAMNIOS:", h3)) oligo_comp = [ "<b>Potter sequence</b> (if early/severe): Pulmonary hypoplasia, limb contractures, flattened facies, talipes", "Cord compression → fetal distress (variable decelerations on CTG)", "IUGR and poor outcome", "Amnioinfusion during labour (saline infusion to dilute meconium / relieve cord compression)", ] for o in oligo_comp: story.append(Paragraph(f"• {o}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 9: ABNORMALITIES OF PLACENTA # ───────────────────────────────────────────── story.append(section_header("9. PLACENTAL ABNORMALITIES", colors.HexColor("#b45309"))) story.append(sp(6)) story.append(Paragraph("TYPES OF PLACENTAL ABNORMALITIES", h2)) plac_types = [ ("<b>Placenta Previa:</b>", "Placenta implanted in lower uterine segment. Types: Type I (lateral/low-lying) → Type IV (central/complete). Causes painless APH."), ("<b>Placenta Accreta Spectrum (PAS):</b>", "Accreta (into myometrium), Increta (through myometrium), Percreta (through serosa). Risk: previous LSCS + placenta previa."), ("<b>Placenta Succenturiata:</b>", "Accessory lobe of placenta connected by blood vessels. Risk: vasa previa if vessels run over cervical os."), ("<b>Circumvallate Placenta:</b>", "Fetal surface smaller than maternal; folded back edges. Associated with APH, preterm labour, IUGR."), ("<b>Bipartite/Multipartite Placenta:</b>", "Placenta divided into 2 or more equal lobes; risk of retained placenta."), ("<b>Battledore Placenta:</b>", "Cord inserted at margin of placenta (marginal cord insertion)."), ("<b>Extrachorial Placenta:</b>", "Circummarginate (flat ring) or circumvallate (folded ring) — associated with complications."), ] for bold_part, rest in plac_types: story.append(Paragraph(f"• {bold_part} {rest}", bullet)) story.append(sp(8)) # ───────────────────────────────────────────── # SECTION 10: CORD ABNORMALITIES # ───────────────────────────────────────────── story.append(section_header("10. CORD ABNORMALITIES", ACCENT_RED)) story.append(sp(6)) cord_data = [ [Paragraph("<b>Abnormality</b>", bold_body), Paragraph("<b>Description / Significance</b>", bold_body)], [Paragraph("Short Cord (<35 cm)", body), Paragraph("Associated with delayed descent, abruptio placentae, cord rupture, uterine inversion", body)], [Paragraph("Long Cord (>100 cm)", body), Paragraph("Prone to knots, loops, prolapse, torsion", body)], [Paragraph("Cord Prolapse", body), Paragraph("Loop of cord descends before presenting part; requires emergency LSCS if cord pulsating and fetus alive", body)], [Paragraph("Cord Presentation", body), Paragraph("Cord in front of presenting part with intact membranes; urgent action needed", body)], [Paragraph("True Knot", body), Paragraph("May cause fetal death by cord occlusion; distinguished from false knots (venous redundancy)", body)], [Paragraph("Nuchal Cord", body), Paragraph("Cord around fetal neck; commonest in 1 loop (25%); usually managed at delivery by slipping over head or clamping", body)], [Paragraph("Velamentous Insertion", body), Paragraph("Cord inserts into membranes before reaching placenta; blood vessels run unprotected — risk of vasa previa and vessel rupture during labour", body)], [Paragraph("Vasa Previa", body), Paragraph("Fetal blood vessels cross over internal os; rupture on ARM causes fetal hemorrhage (Apt test to distinguish fetal vs maternal blood); emergency LSCS", body)], [Paragraph("Single Umbilical Artery (SUA)", body), Paragraph("Associated with congenital anomalies (~20–30%), IUGR; requires detailed anomaly scan", body)], ] tc2 = Table(cord_data, colWidths=[5.5*cm, 12.4*cm]) tc2.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,0), ACCENT_RED), ("TEXTCOLOR", (0,0), (-1,0), WHITE), ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, colors.HexColor("#fee2e2")]), ("GRID", (0,0), (-1,-1), 0.5, BORDER_GREY), ("TOPPADDING", (0,0), (-1,-1), 5), ("BOTTOMPADDING", (0,0), (-1,-1), 5), ("LEFTPADDING", (0,0), (-1,-1), 6), ("VALIGN", (0,0), (-1,-1), "TOP"), ])) story.append(tc2) story.append(sp(8)) # ───────────────────────────────────────────── # QUICK REVISION BOX # ───────────────────────────────────────────── story.append(section_header("QUICK REVISION — HIGH-YIELD POINTS", colors.HexColor("#0f172a"))) story.append(sp(6)) quick = [ "DZ twins = <b>80%</b>; MZ twins = <b>20%</b> | Most common variety: both vertex (<b>50%</b>)", "Chorionicity best at <b>11–14 weeks TVS</b>: Dichorionic = Lambda/Twin peak sign; Monochorionic = T-sign", "Hellin's rule: Twins <b>1:80</b>, Triplets <b>1:80²</b>, Quadruplets <b>1:80³</b>", "Max DZ twin incidence age: <b>30–35 years</b>", "Polyhydramnios AFI <b>>24 cm</b>; Oligohydramnios AFI <b><5 cm</b>", "Most common cause of polyhydramnios in mother: <b>Diabetes mellitus</b>", "Renal agenesis → <b>Potter sequence</b> (oligohydramnios + pulmonary hypoplasia)", "Vasa previa → <b>Apt test</b> to differentiate fetal from maternal blood", "TTTS: donor = small/oligo; recipient = large/poly; Rx = <b>laser photocoagulation</b>", "Fetus papyraceus more common in <b>monozygotic</b> twins", "Conjoined twins — most common: <b>Thoracopagus</b>", "Superfecundation = two ova + two sperms in <b>same cycle</b>; Superfetation = different cycles", ] for i, q in enumerate(quick): bg = YELLOW_BG if i % 2 == 0 else LIGHT_GREEN data = [[Paragraph(f"✦ {q}", S("qr", fontName="Helvetica", fontSize=9.5, textColor=BLACK, leading=14))]] qt = Table(data, colWidths=[doc.width]) qt.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), bg), ("TOPPADDING", (0,0), (-1,-1), 4), ("BOTTOMPADDING", (0,0), (-1,-1), 4), ("LEFTPADDING", (0,0), (-1,-1), 10), ("LINEBELOW", (0,0), (-1,-1), 0.5, BORDER_GREY), ])) story.append(qt) story.append(sp(12)) story.append(Paragraph( "Source: DC Dutta's Textbook of Obstetrics, 10th Edition — Chapter 17", S("src", fontName="Helvetica-Oblique", fontSize=8, textColor=colors.grey, alignment=TA_CENTER) )) doc.build(story) print("PDF created successfully!") import os size = os.path.getsize("/tmp/workspace/notes_output/Chapter17_Notes.pdf") print(f"File size: {size/1024:.1f} KB") PYEOF

Your notes PDF is ready! 🎉

Chapter17 Notes

PDF Document · PDF

Here's what's inside the notes PDF - a fully structured, color-coded study guide on DC Dutta's Obstetrics Chapter 17:

What's covered (10 sections):
  1. Twins - DZ vs MZ comparison table, varieties, special conditions (superfecundation, superfetation, fetus papyraceus, vanishing twin)
  2. Diagnosis of Twins - History, symptoms, abdominal exam findings, investigations
  3. Lie & Presentation - Frequency table (both vertex 50%, 1st vertex 2nd breech 30%, etc.)
  4. Complications - Maternal + fetal/neonatal; TTTS, TRAP, monoamniotic twins, conjoined twins
  5. Antenatal Management - Surveillance, nutrition, timing of delivery
  6. Labour Management - Delivery of 1st and 2nd twin, PPH prevention, LSCS indications
  7. Triplets / Higher Order Multiples - MFPR, ART-related risks
  8. Amniotic Fluid Disorders - Polyhydramnios (chronic vs acute, etiology table, management) + Oligohydramnios (causes, Potter sequence)
  9. Placental Abnormalities - Previa, accreta spectrum, succenturiata, circumvallate, battledore, velamentous insertion
  10. Cord Abnormalities - Full table: short/long cord, prolapse, vasa previa, SUA, nuchal cord
Plus a Quick Revision box with 12 high-yield exam points (Hellin's rule, AFI cutoffs, T-sign vs Lambda sign, Apt test, etc.)

Note: Your PDF was image-only (scanned), so direct text extraction wasn't possible. The notes are built from my medical knowledge of DC Dutta Ch. 17. If any topic from your original PDF was missed, reply with "continue" and I'll add it with a fresh budget.

Make this into a PowerPoint presentation with diagrams

Reading File
Reading File
Running Command

cat << 'PYEOF' > /tmp/workspace/build_pptx.py import os from pptx import Presentation from pptx.util import Inches, Pt, Emu from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE_TYPE from pptx.oxml.ns import qn from pptx.util import Inches, Pt import copy from lxml import etree os.makedirs("/tmp/workspace/pptx_output", exist_ok=True) # ── Colour palette ────────────────────────────────────────────────────────── C_DARK_BLUE = RGBColor(0x1a, 0x3c, 0x6e) C_MED_BLUE = RGBColor(0x25, 0x63, 0xa8) C_LIGHT_BLUE = RGBColor(0xdb, 0xea, 0xfe) C_RED = RGBColor(0xb9, 0x1c, 0x1c) C_GOLD = RGBColor(0xb4, 0x53, 0x09) C_GREEN = RGBColor(0x15, 0x80, 0x3d) C_LIGHT_GRN = RGBColor(0xdc, 0xfc, 0xe7) C_YELLOW = RGBColor(0xfe, 0xf9, 0xc3) C_ORANGE = RGBColor(0xea, 0x58, 0x0c) C_PURPLE = RGBColor(0x7c, 0x3a, 0xed) C_LIGHT_PURP = RGBColor(0xf3, 0xe8, 0xff) C_GREY_BG = RGBColor(0xf1, 0xf5, 0xf9) C_WHITE = RGBColor(0xff, 0xff, 0xff) C_BLACK = RGBColor(0x1e, 0x1e, 0x2e) C_TEAL = RGBColor(0x0f, 0x76, 0x6e) prs = Presentation() prs.slide_width = Inches(13.333) prs.slide_height = Inches(7.5) blank = prs.slide_layouts[6] W = 13.333 # slide width in inches H = 7.5 # slide height in inches # ── Helper functions ───────────────────────────────────────────────────────── def add_rect(slide, x, y, w, h, fill=None, line=None, line_width=Pt(0)): shape = slide.shapes.add_shape( 1, # MSO_SHAPE_TYPE.RECTANGLE Inches(x), Inches(y), Inches(w), Inches(h) ) if fill: shape.fill.solid() shape.fill.fore_color.rgb = fill else: shape.fill.background() if line: shape.line.color.rgb = line shape.line.width = line_width else: shape.line.fill.background() return shape def add_rounded_rect(slide, x, y, w, h, fill=None, line=None, line_width=Pt(1.5), radius=0.1): from pptx.enum.shapes import PP_PLACEHOLDER shape = slide.shapes.add_shape( 5, # ROUNDED_RECTANGLE Inches(x), Inches(y), Inches(w), Inches(h) ) shape.adjustments[0] = radius if fill: shape.fill.solid() shape.fill.fore_color.rgb = fill else: shape.fill.background() if line: shape.line.color.rgb = line shape.line.width = line_width else: shape.line.fill.background() return shape def add_text(slide, text, x, y, w, h, size=18, bold=False, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE, italic=False, wrap=True, margin=0.05): tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame tf.word_wrap = wrap tf.vertical_anchor = v_anchor tf.margin_left = Inches(margin) tf.margin_right = Inches(margin) tf.margin_top = Inches(0.02) tf.margin_bottom = Inches(0.02) p = tf.paragraphs[0] p.alignment = align run = p.add_run() run.text = text run.font.size = Pt(size) run.font.bold = bold run.font.italic = italic run.font.color.rgb = color run.font.name = "Calibri" return tb def add_text_multi(slide, lines, x, y, w, h, default_size=16, v_anchor=MSO_ANCHOR.TOP, margin=0.07, line_spacing=None): """lines = list of (text, size, bold, color, align, italic)""" tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)) tf = tb.text_frame tf.word_wrap = True tf.vertical_anchor = v_anchor tf.margin_left = Inches(margin) tf.margin_right = Inches(margin) tf.margin_top = Inches(0.05) tf.margin_bottom = Inches(0.05) first = True for item in lines: if isinstance(item, str): text, size, bold, color, align, italic = item, default_size, False, C_BLACK, PP_ALIGN.LEFT, False else: text = item[0] size = item[1] if len(item) > 1 else default_size bold = item[2] if len(item) > 2 else False color = item[3] if len(item) > 3 else C_BLACK align = item[4] if len(item) > 4 else PP_ALIGN.LEFT italic= item[5] if len(item) > 5 else False if first: p = tf.paragraphs[0] first = False else: p = tf.add_paragraph() p.alignment = align if line_spacing: p.line_spacing = line_spacing run = p.add_run() run.text = text run.font.size = Pt(size) run.font.bold = bold run.font.italic = italic run.font.color.rgb = color run.font.name = "Calibri" return tb def slide_bg(slide, color): bg = slide.background fill = bg.fill fill.solid() fill.fore_color.rgb = color def add_arrow(slide, x1, y1, x2, y2, color=C_MED_BLUE, width=Pt(2)): """Add a line with arrowhead from (x1,y1) to (x2,y2) in inches.""" from pptx.util import Inches as I2 connector = slide.shapes.add_connector( 1, # STRAIGHT I2(x1), I2(y1), I2(x2), I2(y2) ) connector.line.color.rgb = color connector.line.width = width # Add arrowhead at end from pptx.oxml.ns import qn ln = connector.line._ln tailEnd = etree.SubElement(ln, qn('a:tailEnd')) tailEnd.set('type', 'none') headEnd = etree.SubElement(ln, qn('a:headEnd')) headEnd.set('type', 'arrow') headEnd.set('w', 'med') headEnd.set('len', 'med') return connector def bullet_box(slide, items, x, y, w, h, title=None, title_bg=C_DARK_BLUE, item_bg=C_WHITE, bullet_color=C_MED_BLUE, text_color=C_BLACK, font_size=14, title_size=15, border=C_MED_BLUE): """Draw a labelled bullet box.""" ty = y if title: r = add_rounded_rect(slide, x, ty, w, 0.35, fill=title_bg, line=title_bg, radius=0.05) add_text(slide, title, x+0.1, ty, w-0.2, 0.35, size=title_size, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) ty += 0.38 # Container cont_h = h - (0.38 if title else 0) add_rounded_rect(slide, x, ty, w, cont_h, fill=item_bg, line=border, line_width=Pt(1.2), radius=0.03) # Items lines = [] for item in items: lines.append((f" • {item}", font_size, False, text_color, PP_ALIGN.LEFT)) lines.append(("", font_size-4, False, text_color, PP_ALIGN.LEFT)) # spacer add_text_multi(slide, lines, x+0.1, ty+0.05, w-0.2, cont_h-0.1, default_size=font_size, v_anchor=MSO_ANCHOR.TOP, margin=0.05) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 1 – TITLE # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, C_DARK_BLUE) # Decorative top bar add_rect(slide, 0, 0, W, 0.12, fill=C_MED_BLUE) # Decorative bottom bar add_rect(slide, 0, H-0.12, W, 0.12, fill=C_MED_BLUE) # Accent side strip add_rect(slide, 0, 0, 0.55, H, fill=RGBColor(0x12, 0x28, 0x4a)) # Bright accent line add_rect(slide, 0.55, 0, 0.05, H, fill=C_MED_BLUE) # Chapter badge add_rounded_rect(slide, 1.0, 1.3, 2.2, 0.6, fill=C_MED_BLUE, line=C_LIGHT_BLUE, line_width=Pt(1.5), radius=0.15) add_text(slide, "CHAPTER 17", 1.0, 1.3, 2.2, 0.6, size=14, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) # Main title add_text_multi(slide, [ ("Multiple Pregnancy,", 36, True, C_WHITE, PP_ALIGN.LEFT), ("Amniotic Fluid Disorders,", 36, True, RGBColor(0xba, 0xd4, 0xf9), PP_ALIGN.LEFT), ("Abnormalities of Placenta", 36, True, RGBColor(0xba, 0xd4, 0xf9), PP_ALIGN.LEFT), ("and Cord", 36, True, RGBColor(0xba, 0xd4, 0xf9), PP_ALIGN.LEFT), ], 1.0, 2.05, 9.5, 3.4, v_anchor=MSO_ANCHOR.TOP, margin=0.05) # Source add_text(slide, "DC Dutta's Obstetrics — 10th Edition", 1.0, 5.6, 9.0, 0.45, size=14, italic=True, color=RGBColor(0x93, 0xc5, 0xfd), align=PP_ALIGN.LEFT) # Slide number hint (topics) topics_text = "Twins • Amniotic Fluid • Placenta • Cord" add_text(slide, topics_text, 1.0, 6.2, 10.0, 0.45, size=13, color=RGBColor(0x64, 0x74, 0x8b), align=PP_ALIGN.LEFT) # Decorative circles from pptx.enum.shapes import MSO_CONNECTOR_TYPE def add_circle(slide, x, y, d, fill, alpha_fill=None): shape = slide.shapes.add_shape(9, Inches(x), Inches(y), Inches(d), Inches(d)) shape.fill.solid() shape.fill.fore_color.rgb = fill shape.line.fill.background() return shape add_circle(slide, 10.8, 0.6, 2.2, RGBColor(0x1e, 0x4d, 0x8c)) add_circle(slide, 11.3, 0.3, 1.4, RGBColor(0x25, 0x63, 0xa8)) add_circle(slide, 11.8, 4.8, 1.6, RGBColor(0x1e, 0x4d, 0x8c)) add_circle(slide, 12.2, 5.5, 0.9, C_MED_BLUE) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 2 – CHAPTER OUTLINE # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, C_GREY_BG) # Header add_rect(slide, 0, 0, W, 1.1, fill=C_DARK_BLUE) add_rect(slide, 0, 1.1, W, 0.06, fill=C_MED_BLUE) add_text(slide, "CHAPTER OUTLINE", 0.4, 0.1, 12, 0.9, size=30, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) topics = [ ("1", "Twins", "Types, Varieties, Genesis, Incidence"), ("2", "Diagnosis", "History, Symptoms, Exam, Investigations"), ("3", "Complications", "Maternal, Fetal, Monochorionic"), ("4", "Antenatal Mgmt", "Surveillance, Nutrition, Delivery Planning"), ("5", "Labour Mgmt", "1st & 2nd Twin, PPH Prevention"), ("6", "Triplets / HOMs", "Higher-Order Multiples, MFPR"), ("7", "Amniotic Fluid", "Polyhydramnios, Oligohydramnios"), ("8", "Placenta", "Placental Abnormalities"), ("9", "Cord", "Cord Abnormalities, Vasa Previa"), ("10", "Quick Revision", "High-Yield Exam Points"), ] cols = 2 rows = 5 box_w = 5.8 box_h = 1.0 x_starts = [0.35, 6.9] y_start = 1.3 colors_cycle = [C_DARK_BLUE, C_MED_BLUE, C_TEAL, C_GREEN, C_PURPLE, C_RED, C_GOLD, C_ORANGE, RGBColor(0x6d, 0x28, 0xd9), C_TEAL] for i, (num, title, sub) in enumerate(topics): col = i % 2 row = i // 2 x = x_starts[col] y = y_start + row * (box_h + 0.13) c = colors_cycle[i] # Card bg add_rounded_rect(slide, x, y, box_w, box_h, fill=C_WHITE, line=c, line_width=Pt(2), radius=0.08) # Number badge add_circle(slide, x + 0.08, y + 0.18, 0.62, c) add_text(slide, num, x+0.08, y+0.18, 0.62, 0.62, size=18, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) # Title + sub add_text(slide, title, x + 0.82, y + 0.06, box_w - 0.95, 0.44, size=16, bold=True, color=c, align=PP_ALIGN.LEFT) add_text(slide, sub, x + 0.82, y + 0.52, box_w - 0.95, 0.42, size=12, color=RGBColor(0x64, 0x74, 0x8b), align=PP_ALIGN.LEFT) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 3 – TWINS: TYPES & VARIETIES # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf8, 0xfa, 0xff)) add_rect(slide, 0, 0, W, 1.05, fill=C_DARK_BLUE) add_rect(slide, 0, 1.05, W, 0.05, fill=C_MED_BLUE) add_text(slide, "TWINS — TYPES & VARIETIES", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # DZ Box add_rounded_rect(slide, 0.3, 1.25, 5.9, 5.85, fill=C_WHITE, line=C_MED_BLUE, line_width=Pt(2), radius=0.07) add_rect(slide, 0.3, 1.25, 5.9, 0.55, fill=C_MED_BLUE) add_text(slide, "DIZYGOTIC (DZ) — 80%", 0.4, 1.25, 5.7, 0.55, size=17, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) dz_items = [ "Syn: Fraternal / Binovular", "Two ova fertilized by two sperms in same ovarian cycle", "Two separate placentae (or fused at margin)", "4-layer intervening membrane: amnion+chorion+chorion+amnion (>2 mm)", "Sex: May differ", "Genetics: Differ (like siblings from diff. births)", "Highest in Africa (Nigeria 1:20); lowest Japan (1:250)", "India: ~1 in 80", "Influenced by: race, family history, advanced maternal age, ART, high parity", ] y_item = 1.9 for item in dz_items: add_circle(slide, 0.45, y_item + 0.06, 0.15, C_MED_BLUE) add_text(slide, item, 0.72, y_item, 5.3, 0.42, size=13, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_item += 0.44 # MZ Box add_rounded_rect(slide, 6.9, 1.25, 5.9, 5.85, fill=C_WHITE, line=C_GREEN, line_width=Pt(2), radius=0.07) add_rect(slide, 6.9, 1.25, 5.9, 0.55, fill=C_GREEN) add_text(slide, "MONOZYGOTIC (MZ) — 20%", 7.0, 1.25, 5.7, 0.55, size=17, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) mz_items = [ "Syn: Identical / Uniovular", "Cleavage of a single fertilized ovum", "Single placenta (varying anastomoses)", "Chorionicity depends on TIMING of division", "Sex: Always identical", "Genetics: Same", "Constant worldwide: ~1 in 250", "Frequency NOT affected by race/ART", "Associated with higher complication rate", ] y_item = 1.9 for item in mz_items: add_circle(slide, 7.05, y_item + 0.06, 0.15, C_GREEN) add_text(slide, item, 7.32, y_item, 5.3, 0.42, size=13, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_item += 0.44 # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 4 – CHORIONICITY DIAGRAM # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf0, 0xf4, 0xff)) add_rect(slide, 0, 0, W, 1.05, fill=C_PURPLE) add_text(slide, "CHORIONICITY — TIMING OF DIVISION", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # Timeline arrow add_rect(slide, 0.5, 2.7, 12.0, 0.1, fill=C_PURPLE) # Arrow head arrow_shape = slide.shapes.add_shape(13, Inches(12.3), Inches(2.45), Inches(0.45), Inches(0.6)) arrow_shape.fill.solid(); arrow_shape.fill.fore_color.rgb = C_PURPLE arrow_shape.line.fill.background() # Timeline labels timeline_pts = [ (0.5, "0", "Fertilization"), (2.5, "<72h", "D/D"), (5.5, "Day 4–7","D/M"), (8.8, "Day 8–12","M/M"), (11.5, ">Day 13","Conjoined"), ] boxes = [ ("<72 hrs", "Diamniotic\nDichorionic", "D/D", "25–30%", C_MED_BLUE, C_LIGHT_BLUE), ("Day 4–7", "Diamniotic\nMonochorionic", "D/M", "70–75%", C_GREEN, C_LIGHT_GRN), ("Day 8–12", "Monoamniotic\nMonochorionic","M/M", "1–2%", C_GOLD, C_YELLOW), (">Day 13", "Conjoined\n(Siamese)", "Conj","<1%", C_RED, RGBColor(0xff,0xe4,0xe4)), ] x_positions = [0.45, 3.4, 6.35, 9.3] for i, (timing, mem_status, abbrev, pct, fg, bg) in enumerate(boxes): x = x_positions[i] # Top card (timing + percentage) add_rounded_rect(slide, x, 1.2, 2.85, 1.2, fill=bg, line=fg, line_width=Pt(2), radius=0.08) add_text(slide, timing, x+0.1, 1.22, 2.65, 0.48, size=15, bold=True, color=fg, align=PP_ALIGN.CENTER) add_text(slide, pct, x+0.1, 1.68, 2.65, 0.65, size=22, bold=True, color=fg, align=PP_ALIGN.CENTER) # Dot on timeline add_circle(slide, x+1.22, 2.55, 0.25, fg) # Bottom card (membrane status) add_rounded_rect(slide, x, 3.0, 2.85, 1.6, fill=C_WHITE, line=fg, line_width=Pt(1.5), radius=0.08) add_text(slide, abbrev, x+0.1, 3.05, 2.65, 0.5, size=20, bold=True, color=fg, align=PP_ALIGN.CENTER) add_text(slide, mem_status, x+0.1, 3.52, 2.65, 0.9, size=13, color=C_BLACK, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) # Key signs box add_rounded_rect(slide, 0.45, 4.75, 12.1, 2.35, fill=C_LIGHT_BLUE, line=C_MED_BLUE, line_width=Pt(1.5), radius=0.07) add_text(slide, "KEY ULTRASOUND SIGNS FOR CHORIONICITY (Best at 11–14 weeks TVS)", 0.6, 4.82, 12.0, 0.45, size=14, bold=True, color=C_DARK_BLUE, align=PP_ALIGN.LEFT) # Lambda sign box add_rounded_rect(slide, 0.65, 5.35, 5.5, 1.55, fill=C_WHITE, line=C_MED_BLUE, line_width=Pt(1.5), radius=0.07) add_text(slide, "⬦ LAMBDA SIGN (Twin Peak Sign)", 0.75, 5.38, 5.3, 0.45, size=13, bold=True, color=C_MED_BLUE, align=PP_ALIGN.LEFT) add_text(slide, "Dichorionic — Thick septum >2 mm\nChorion + amnion on each side\nPlacental villi fill potential space", 0.75, 5.8, 5.3, 1.0, size=12, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # T-sign box add_rounded_rect(slide, 6.7, 5.35, 5.5, 1.55, fill=C_WHITE, line=C_GREEN, line_width=Pt(1.5), radius=0.07) add_text(slide, "⬦ T-SIGN", 6.8, 5.38, 5.3, 0.45, size=13, bold=True, color=C_GREEN, align=PP_ALIGN.LEFT) add_text(slide, "Monochorionic — Thin septum <2 mm\nAmnion only (2 layers), no chorion\nCharacteristic 'T' at placental insertion", 6.8, 5.8, 5.3, 1.0, size=12, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 5 – INCIDENCE & RISK FACTORS # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf8, 0xfa, 0xff)) add_rect(slide, 0, 0, W, 1.05, fill=C_GOLD) add_text(slide, "INCIDENCE & RISK FACTORS FOR DIZYGOTIC TWINS", 0.4, 0.05, 12.5, 0.95, size=26, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # Hellin's Rule visual add_rounded_rect(slide, 0.3, 1.2, 5.5, 2.2, fill=C_YELLOW, line=C_GOLD, line_width=Pt(2), radius=0.1) add_text(slide, "HELLIN'S RULE", 0.45, 1.25, 5.2, 0.45, size=16, bold=True, color=C_GOLD, align=PP_ALIGN.CENTER) hellin = [ ("TWINS", "1 : 80", C_MED_BLUE), ("TRIPLETS", "1 : 80²", C_GREEN), ("QUADRUPLETS", "1 : 80³", C_RED), ] for i, (label, val, col) in enumerate(hellin): add_rounded_rect(slide, 0.5 + i*1.72, 1.78, 1.5, 1.4, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.1) add_text(slide, val, 0.5+i*1.72, 1.82, 1.5, 0.72, size=18, bold=True, color=col, align=PP_ALIGN.CENTER) add_text(slide, label, 0.5+i*1.72, 2.52, 1.5, 0.55, size=10, bold=True, color=RGBColor(0x64,0x74,0x8b), align=PP_ALIGN.CENTER) # Country incidence bar chart (visual) add_rounded_rect(slide, 0.3, 3.5, 5.5, 3.7, fill=C_WHITE, line=C_GOLD, line_width=Pt(1.5), radius=0.07) add_text(slide, "INCIDENCE BY REGION", 0.4, 3.55, 5.3, 0.42, size=14, bold=True, color=C_GOLD, align=PP_ALIGN.LEFT) countries = [ ("Nigeria (highest)", 5.0, C_RED), ("India", 2.5, C_ORANGE), ("Caucasians", 2.0, C_MED_BLUE), ("Japan (lowest)", 0.4, C_GREEN), ] bar_y = 4.08 bar_max_w = 4.2 for country, ratio, col in countries: add_text(slide, country, 0.45, bar_y, 2.1, 0.38, size=12, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) bar_w = (ratio / 5.0) * bar_max_w add_rounded_rect(slide, 2.5, bar_y + 0.05, bar_w, 0.28, fill=col, line=None, radius=0.05) add_text(slide, f"1:{int(80/ratio*80)}" if country != "Nigeria (highest)" else "1:20", 2.5 + bar_w + 0.1, bar_y, 0.7, 0.38, size=11, bold=True, color=col, align=PP_ALIGN.LEFT) bar_y += 0.55 # Risk factors add_rounded_rect(slide, 6.1, 1.2, 6.85, 6.0, fill=C_WHITE, line=C_GOLD, line_width=Pt(2), radius=0.08) add_rect(slide, 6.1, 1.2, 6.85, 0.5, fill=C_GOLD) add_text(slide, "RISK FACTORS FOR DZ TWINS", 6.2, 1.22, 6.65, 0.46, size=15, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) rf = [ ("Race", "Highest Africa; lowest East Asia; intermediate Caucasians", C_RED), ("Family History", "Hereditary predisposition via FEMALE (maternal) side", C_MED_BLUE), ("Maternal Age", "Peaks at 30–35 years (maximum incidence)", C_PURPLE), ("ART / Ovulation\nInduction", "Gonadotropins 12–15%; Clomiphene 7–9%; Letrozole 5%", C_TEAL), ("Parity", "Increases from 5th gravida onward", C_GREEN), ] y_rf = 1.85 for icon, detail, col in rf: add_rounded_rect(slide, 6.25, y_rf, 6.55, 0.95, fill=RGBColor(0xf8,0xfa,0xff), line=col, line_width=Pt(1.5), radius=0.07) add_rect(slide, 6.25, y_rf, 0.12, 0.95, fill=col) add_text(slide, icon, 6.45, y_rf+0.03, 2.2, 0.4, size=13, bold=True, color=col, align=PP_ALIGN.LEFT) add_text(slide, detail, 6.45, y_rf+0.43, 6.2, 0.45, size=11, color=RGBColor(0x37,0x41,0x51), align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) y_rf += 1.05 # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 6 – DIAGNOSIS OF TWINS # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf8, 0xfa, 0xff)) add_rect(slide, 0, 0, W, 1.05, fill=C_TEAL) add_text(slide, "DIAGNOSIS OF TWINS", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # 4 columns sections = [ ("HISTORY", C_MED_BLUE, [ "Ovulation-inducing drugs\n(gonadotropins for infertility / ART)", "Family history of twinning\n(maternal side more significant)", "Previous twin pregnancies", ]), ("SYMPTOMS", C_PURPLE, [ "Increased nausea & vomiting\n(early months)", "Cardiorespiratory embarrassment\n(palpitation, SOB) — later months", "Leg swelling, varicose veins,\nhemorrhoids more severe", "Unusual abdominal enlargement\n& excessive fetal movements", ]), ("ABDOMINAL EXAM", C_TEAL, [ "Inspection: 'Barrel-shaped' uterus;\nunduly enlarged abdomen", "Palpation: Ht of uterus > POA;\nabdomen girth >100 cm at term", "Too many fetal parts palpable;\n2 fetal heads / 3 fetal poles", "Auscultation: 2 distinct FHSs at\nseparate spots, silent area in between;\ndifference ≥10 bpm", ]), ("INVESTIGATIONS", C_GOLD, [ "Sonography (key):\n• Confirm from 10th week\n• Chorionicity at 11–14 wks\n• Serial growth every 3–4 wks\n• Doppler for TTTS", "Blood tests: CBC (anemia),\nblood group, Rh, OGTT", "Urine: routine & culture", "AFI assessment each scan", ]), ] x_start = 0.25 col_w = 3.1 for i, (title, col, items) in enumerate(sections): x = x_start + i * (col_w + 0.12) add_rounded_rect(slide, x, 1.18, col_w, 5.95, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.08) add_rect(slide, x, 1.18, col_w, 0.5, fill=col) # Rounded top corners hack: overlay rect on bottom of header add_text(slide, title, x+0.08, 1.18, col_w-0.16, 0.5, size=14, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) y_i = 1.78 for item in items: add_rect(slide, x+0.15, y_i+0.06, 0.18, 0.18, fill=col) add_text(slide, item, x+0.4, y_i, col_w-0.5, 0.85, size=11.5, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) y_i += 0.92 if len(item) < 60 else 1.05 # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 7 – COMPLICATIONS (DIAGRAM) # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xfff5f5)) add_rect(slide, 0, 0, W, 1.05, fill=C_RED) add_text(slide, "COMPLICATIONS OF TWIN PREGNANCY", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # Central node add_circle(slide, 5.3, 2.9, 1.7, C_RED) add_text(slide, "TWIN\nPREGNANCY\nCOMPLICATIONS", 5.3, 2.92, 1.7, 1.7, size=12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) # Satellite boxes sat_items = [ (0.1, 1.3, "MATERNAL", [ "Anemia (hemodilution)", "Preeclampsia (25%)", "Polyhydramnios", "Preterm labour ★", "Malpresentations", "APH / PPH", ], C_MED_BLUE), (0.1, 4.5, "DELIVERY", [ "Cord prolapse", "Locked twins (rare)", "Operative delivery ↑", "PPH risk (atony)", "Puerperal sepsis", ], C_PURPLE), (7.3, 1.3, "FETAL", [ "Preterm birth ★", "IUGR", "Congenital malformations 2×", "Perinatal mortality 3–4×", "Vanishing twin", ], C_ORANGE), (7.3, 4.5, "MONOCHORIONIC\nSPECIFIC", [ "TTTS — laser Rx", "TRAP / Fetus acardiacus", "Cord entanglement (M/M)", "IUD of one twin → DIC", "Conjoined twins", ], C_RED), ] for x, y, title, items, col in sat_items: add_rounded_rect(slide, x, y, 5.0, 2.8, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.08) add_rect(slide, x, y, 5.0, 0.45, fill=col) add_text(slide, title, x+0.1, y+0.02, 4.8, 0.42, size=14, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) y_i = y + 0.55 for item in items: add_circle(slide, x+0.18, y_i+0.07, 0.16, col) add_text(slide, item, x+0.42, y_i, 4.4, 0.38, size=12, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_i += 0.38 # TTTS highlight add_rounded_rect(slide, 5.05, 5.7, 3.1, 1.5, fill=C_YELLOW, line=C_GOLD, line_width=Pt(2), radius=0.08) add_text(slide, "TTTS KEY FACTS", 5.15, 5.75, 2.9, 0.38, size=12, bold=True, color=C_GOLD, align=PP_ALIGN.LEFT) add_text(slide, "Donor: small, anemic, oligo\nRecipient: large, polycythemia, poly\nRx: LASER photocoagulation", 5.15, 6.1, 2.9, 0.9, size=11, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 8 – ANTENATAL & LABOUR MANAGEMENT # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf0, 0xfd, 0xf4)) add_rect(slide, 0, 0, W, 1.05, fill=C_TEAL) add_text(slide, "MANAGEMENT OF TWIN PREGNANCY", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # Antenatal steps — flowchart style antenatal_steps = [ ("CONFIRM & DATE", "USG at 6–8 wks\nChorionicity at 11–14 wks"), ("NUTRITION", "↑ Iron, Folic acid, Calcium\nHigh-calorie diet"), ("SURVEILLANCE", "Serial growth scans q3–4 wks\nDoppler in MC twins"), ("PRETERM PREVENTION", "Cervical length monitoring\nCorticosteroids if needed"), ("DELIVERY PLANNING", "Uncomplicated: 36–38 wks\nMC/MA twins: earlier"), ] flow_x = [0.3, 2.85, 5.4, 7.95, 10.5] for i, (title, detail) in enumerate(antenatal_steps): x = flow_x[i] add_rounded_rect(slide, x, 1.2, 2.35, 2.0, fill=C_WHITE, line=C_TEAL, line_width=Pt(2), radius=0.08) add_rect(slide, x, 1.2, 2.35, 0.45, fill=C_TEAL) # Step number add_circle(slide, x + 1.95, 1.05, 0.35, C_TEAL) add_text(slide, str(i+1), x+1.95, 1.05, 0.35, 0.35, size=13, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) add_text(slide, title, x+0.08, 1.22, 2.19, 0.42, size=12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) add_text(slide, detail, x+0.1, 1.72, 2.15, 1.4, size=11.5, color=C_BLACK, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.TOP) # Arrow to next if i < 4: add_rect(slide, x+2.35, 2.12, 0.5, 0.06, fill=C_TEAL) # Arrow head arr = slide.shapes.add_shape(13, Inches(x+2.78), Inches(1.98), Inches(0.18), Inches(0.32)) arr.fill.solid(); arr.fill.fore_color.rgb = C_TEAL arr.line.fill.background() # Labour Management add_rect(slide, 0.3, 3.4, W-0.6, 0.05, fill=C_TEAL) add_text(slide, "MANAGEMENT DURING LABOUR", 0.3, 3.5, 5.0, 0.45, size=17, bold=True, color=C_TEAL, align=PP_ALIGN.LEFT) labour_cols = [ ("SET-UP", C_MED_BLUE, [ "IV access + cross-match", "Continuous CTG both fetuses", "Consultant OB + neonatologist", "Epidural anaesthesia preferred", ]), ("1ST TWIN DELIVERY", C_TEAL, [ "Vertex → SVD", "Breech → LSCS (usually)", "Monitor FHR continuously", "Paediatrician standby", ]), ("2ND TWIN (within 30 min)", C_PURPLE, [ "Re-assess lie by palpation/USG", "Vertex: ARM + oxytocin → SVD", "Breech: Assisted breech delivery", "Transverse: ECV → if fail → IPV + breech extraction", ]), ("3RD STAGE", C_RED, [ "Active management MANDATORY", "High PPH risk (uterine atony)", "Oxytocin infusion", "Monitor closely post-delivery", ]), ] x_l = 0.3 col_w_l = 3.0 for i, (title, col, items) in enumerate(labour_cols): x = x_l + i * (col_w_l + 0.17) add_rounded_rect(slide, x, 4.05, col_w_l, 3.15, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.08) add_rect(slide, x, 4.05, col_w_l, 0.42, fill=col) add_text(slide, title, x+0.08, 4.07, col_w_l-0.16, 0.38, size=12, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER) y_i = 4.56 for item in items: add_rect(slide, x+0.15, y_i+0.06, 0.15, 0.15, fill=col) add_text(slide, item, x+0.38, y_i, col_w_l-0.5, 0.55, size=11, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) y_i += 0.58 # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 9 – AMNIOTIC FLUID DISORDERS # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xf5, 0xf0, 0xff)) add_rect(slide, 0, 0, W, 1.05, fill=C_PURPLE) add_text(slide, "AMNIOTIC FLUID DISORDERS", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) # Two panels # LEFT: Polyhydramnios add_rounded_rect(slide, 0.3, 1.15, 6.1, 6.1, fill=C_WHITE, line=C_PURPLE, line_width=Pt(2.5), radius=0.1) add_rect(slide, 0.3, 1.15, 6.1, 0.6, fill=C_PURPLE) add_text(slide, "POLYHYDRAMNIOS", 0.5, 1.18, 5.7, 0.55, size=18, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) add_text(slide, "AFI > 24 cm | DVP > 8 cm", 0.5, 1.8, 5.7, 0.38, size=13, bold=True, color=C_PURPLE, align=PP_ALIGN.LEFT) # Etiology mini-boxes etio_groups = [ ("Fetal (~25%)", [ "Anencephaly / spina bifida", "Esophageal / duodenal atresia", "Diaphragmatic hernia", "Fetal hydrops", ], C_MED_BLUE), ("Maternal (~25%)", [ "Diabetes mellitus ★", "Rh isoimmunization", "Multiple pregnancy (TTTS)", ], C_GOLD), ("Idiopathic (~50%)", [ "No identifiable cause", "Usually mild/chronic", ], C_GREEN), ] y_e = 2.25 for eg_title, eg_items, col in etio_groups: add_rounded_rect(slide, 0.45, y_e, 5.8, 0.3 + len(eg_items)*0.3, fill=RGBColor(0xf8,0xf4,0xff), line=col, line_width=Pt(1.2), radius=0.06) add_rect(slide, 0.45, y_e, 1.45, 0.3 + len(eg_items)*0.3, fill=col) add_text(slide, eg_title, 0.46, y_e + 0.05, 1.43, 0.3 + len(eg_items)*0.3 - 0.1, size=11, bold=True, color=C_WHITE, align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE) for j, item in enumerate(eg_items): add_text(slide, f"• {item}", 2.0, y_e + 0.05 + j*0.3, 4.1, 0.28, size=11, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_e += 0.35 + len(eg_items)*0.3 + 0.12 add_text(slide, "COMPLICATIONS", 0.5, y_e + 0.05, 5.7, 0.38, size=13, bold=True, color=C_PURPLE, align=PP_ALIGN.LEFT) poly_comp = ["Dyspnea, edema, varicosities", "Preterm labour", "Malpresentation, PROM, cord prolapse", "Abruption on decompression", "PPH (uterine atony)"] y_c = y_e + 0.45 for c_item in poly_comp: add_circle(slide, 0.55, y_c+0.07, 0.14, C_PURPLE) add_text(slide, c_item, 0.8, y_c, 5.4, 0.35, size=11.5, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_c += 0.36 # RIGHT: Oligohydramnios add_rounded_rect(slide, 6.85, 1.15, 6.1, 6.1, fill=C_WHITE, line=C_RED, line_width=Pt(2.5), radius=0.1) add_rect(slide, 6.85, 1.15, 6.1, 0.6, fill=C_RED) add_text(slide, "OLIGOHYDRAMNIOS", 7.05, 1.18, 5.7, 0.55, size=18, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) add_text(slide, "AFI < 5 cm | DVP < 2 cm", 7.05, 1.8, 5.7, 0.38, size=13, bold=True, color=C_RED, align=PP_ALIGN.LEFT) oligo_causes = [ ("Fetal renal anomalies", "Renal agenesis → POTTER SEQUENCE\nPolycystic kidneys\nObstructive uropathy", C_RED), ("IUGR / UPI", "Kidneys hypoperfused\nDecreased fetal urine output", C_ORANGE), ("Post-term pregnancy", "Placental insufficiency\nAFI <5 cm → deliver", C_GOLD), ("PPROM", "Leakage of liquor\nMost common cause in 2nd trimester", C_MED_BLUE), ("Drugs", "Indomethacin, ACE inhibitors\n(2nd/3rd trimester)", C_PURPLE), ] y_o = 2.25 for cause, detail, col in oligo_causes: add_rounded_rect(slide, 7.0, y_o, 5.8, 0.82, fill=RGBColor(0xff,0xf5,0xf5), line=col, line_width=Pt(1.2), radius=0.06) add_rect(slide, 7.0, y_o, 0.1, 0.82, fill=col) add_text(slide, cause, 7.18, y_o+0.03, 2.0, 0.35, size=12, bold=True, color=col, align=PP_ALIGN.LEFT) add_text(slide, detail, 7.18, y_o+0.38, 5.5, 0.38, size=11, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) y_o += 0.93 # Potter sequence box add_rounded_rect(slide, 7.0, y_o + 0.08, 5.8, 1.4, fill=RGBColor(0xff, 0xed, 0xed), line=C_RED, line_width=Pt(2), radius=0.08) add_text(slide, "⚠ POTTER SEQUENCE (Oligohydramnios Sequence)", 7.1, y_o+0.12, 5.6, 0.45, size=12, bold=True, color=C_RED, align=PP_ALIGN.LEFT) add_text(slide, "Pulmonary hypoplasia • Limb contractures\nFlattened facies • Talipes\nManagement: Amnioinfusion during labour", 7.1, y_o+0.55, 5.6, 0.85, size=11.5, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 10 – PLACENTAL ABNORMALITIES # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xfff8f0)) add_rect(slide, 0, 0, W, 1.05, fill=C_GOLD) add_text(slide, "PLACENTAL ABNORMALITIES", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) plac_items = [ ("Placenta Previa", "Implanted in lower uterine segment\nTypes I–IV (lateral → central/complete)\nClassic: Painless, causeless, recurrent APH", C_RED), ("Placenta Accreta Spectrum (PAS)", "Accreta (into myometrium) → Increta (through) → Percreta (through serosa)\nRisk factors: previous LSCS + previa\nRx: multidisciplinary, possible hysterectomy", C_ORANGE), ("Placenta Succenturiata", "Accessory lobe connected by vessels\nVASA PREVIA risk if vessels cross cervical os\nRisk: retained accessory lobe, PPH", C_MED_BLUE), ("Circumvallate Placenta", "Fetal surface smaller; edges folded back\nAssociated with APH, preterm labour, IUGR", C_PURPLE), ("Bipartite / Multipartite", "Placenta divided into 2+ equal lobes\nRisk: retained placenta → PPH", C_TEAL), ("Battledore Placenta", "Cord inserts at MARGIN of placenta\n(Marginal cord insertion)\nGenerally benign", C_GREEN), ("Velamentous Insertion", "Cord inserts into MEMBRANES, not placenta\nUnprotected vessels → risk of VASA PREVIA\nVessel rupture on ARM → fetal hemorrhage", C_RED), ] rows_plac = [plac_items[:4], plac_items[4:]] y_rows = [1.18, 4.4] for row_i, row in enumerate(rows_plac): y = y_rows[row_i] col_w_p = (W - 0.6) / len(row) for col_i, (title, detail, col) in enumerate(row): x = 0.3 + col_i * (col_w_p + 0.02) add_rounded_rect(slide, x, y, col_w_p - 0.02, 3.0, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.08) add_rect(slide, x, y, col_w_p - 0.02, 0.48, fill=col) add_text(slide, title, x+0.08, y+0.02, col_w_p-0.18, 0.44, size=12.5, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) add_text(slide, detail, x+0.1, y+0.54, col_w_p-0.2, 2.35, size=11.5, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 11 – CORD ABNORMALITIES # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0xff, 0xf5, 0xf5)) add_rect(slide, 0, 0, W, 1.05, fill=C_RED) add_text(slide, "CORD ABNORMALITIES", 0.4, 0.05, 12, 0.95, size=28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) cord_items = [ ("Short Cord\n(<35 cm)", "Delayed descent, abruption,\ncord rupture, uterine inversion", C_MED_BLUE), ("Long Cord\n(>100 cm)", "Knots, loops, prolapse, torsion", C_PURPLE), ("Cord Prolapse", "Loop before presenting part\nEmergency LSCS if cord pulsating", C_RED), ("Cord Presentation", "Cord in front with intact membranes\nUrgent intervention needed", C_ORANGE), ("True Knot", "Can cause fetal death by occlusion\nDistinguish from false knots", C_RED), ("Nuchal Cord", "Cord around fetal neck\n25% have 1 loop; slip over head at delivery", C_TEAL), ("Velamentous Insertion", "Cord → membranes → placenta\nVessels unprotected; vasa previa risk", C_MED_BLUE), ("Vasa Previa", "Fetal vessels cross internal os\nAPT TEST to confirm fetal blood\nEmergency LSCS", C_RED), ("Single Umbilical\nArtery", "Associated with congenital anomalies\n20–30% cases; detailed anomaly scan", C_PURPLE), ] cols_c = 3 col_w_c = 4.1 for i, (title, detail, col) in enumerate(cord_items): row_c = i // cols_c c_col = i % cols_c x = 0.3 + c_col * (col_w_c + 0.21) y = 1.18 + row_c * 2.1 add_rounded_rect(slide, x, y, col_w_c, 1.95, fill=C_WHITE, line=col, line_width=Pt(2), radius=0.08) add_rect(slide, x, y, col_w_c, 0.48, fill=col) add_text(slide, title, x+0.1, y+0.03, col_w_c-0.2, 0.42, size=13, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) add_text(slide, detail, x+0.1, y+0.54, col_w_c-0.2, 1.3, size=12, color=C_BLACK, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.TOP) # Vasa Previa highlight banner add_rounded_rect(slide, 0.3, 7.12, 12.7, 0.25, fill=RGBColor(0xff,0xed,0xed), line=C_RED, line_width=Pt(1.5), radius=0.05) add_text(slide, "★ VASA PREVIA: APT TEST to distinguish fetal (alkali-resistant) vs maternal blood — EMERGENCY LSCS if fetal vessels rupture", 0.45, 7.12, 12.4, 0.25, size=10.5, bold=True, color=C_RED, align=PP_ALIGN.CENTER) # ═══════════════════════════════════════════════════════════════════════════ # SLIDE 12 – QUICK REVISION / HIGH-YIELD # ═══════════════════════════════════════════════════════════════════════════ slide = prs.slides.add_slide(blank) slide_bg(slide, RGBColor(0x0f, 0x17, 0x2a)) add_rect(slide, 0, 0, W, 1.05, fill=RGBColor(0x1e, 0x40, 0xaf)) add_text(slide, "QUICK REVISION — HIGH-YIELD EXAM POINTS", 0.4, 0.05, 12, 0.95, size=26, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT) qr_items = [ ("DZ twins = 80%; MZ = 20%", C_MED_BLUE), ("Most common lie: Both vertex (50%)", C_GREEN), ("Chorionicity best at 11–14 weeks TVS", C_GOLD), ("Lambda sign → Dichorionic; T-sign → Monochorionic", C_PURPLE), ("Hellin's: Twins 1:80 | Triplets 1:80² | Quadruplets 1:80³", C_ORANGE), ("Max DZ incidence: age 30–35 years", C_TEAL), ("Polyhydramnios: AFI >24 cm; Oligohydramnios: AFI <5 cm", C_RED), ("Most common maternal cause of polyhydramnios: Diabetes mellitus", C_GOLD), ("Renal agenesis → Potter sequence (oligo + pulmonary hypoplasia)", C_MED_BLUE), ("Vasa Previa → Apt test to confirm fetal blood → Emergency LSCS", C_RED), ("TTTS: Donor = small/oligo; Recipient = large/poly → Laser Rx", C_PURPLE), ("Fetus papyraceus: more common in MONOZYGOTIC twins", C_GREEN), ("Conjoined twins — most common type: THORACOPAGUS", C_ORANGE), ("Superfecundation = same cycle; Superfetation = different cycles", C_TEAL), ("2nd twin must be delivered within 30 min of 1st twin", C_RED), ] col1 = qr_items[:8] col2 = qr_items[8:] col_starts = [(0.3, col1), (6.95, col2)] for x_start_c, items in col_starts: y_q = 1.18 for text, col in items: add_rounded_rect(slide, x_start_c, y_q, 6.35, 0.52, fill=RGBColor(0x1e, 0x2d, 0x4f), line=col, line_width=Pt(2), radius=0.07) add_rect(slide, x_start_c, y_q, 0.12, 0.52, fill=col) add_text(slide, text, x_start_c + 0.22, y_q + 0.04, 6.0, 0.44, size=12.5, color=C_WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE) y_q += 0.56 # Footer add_text(slide, "Source: DC Dutta's Textbook of Obstetrics, 10th Edition — Chapter 17", 0.3, 7.25, 12.7, 0.25, size=10, italic=True, color=RGBColor(0x64, 0x74, 0x8b), align=PP_ALIGN.CENTER) # ═══════════════════════════════════════════════════════════════════════════ # SAVE # ═══════════════════════════════════════════════════════════════════════════ out_path = "/tmp/workspace/pptx_output/Chapter17_MultiplePregnancy.pptx" prs.save(out_path) import os size = os.path.getsize(out_path) print(f"✅ Saved: {out_path}") print(f" Size: {size/1024:.1f} KB") print(f" Slides: {len(prs.slides)}") PYEOF python3 /tmp/workspace/build_pptx.py

Running Command

sed -i 's/slide_bg(slide, RGBColor(0xfff5f5))/slide_bg(slide, RGBColor(0xff, 0xf5, 0xf5))/' /tmp/workspace/build_pptx.py python3 /tmp/workspace/build_pptx.py

Running Command

# Fix all single-arg RGBColor calls in the file python3 << 'EOF' import re with open("/tmp/workspace/build_pptx.py", "r") as f: content = f.read() # Find all RGBColor(0xRRGGBB) patterns and convert to 3-arg form def fix_rgb(m): val = int(m.group(1), 16) r = (val >> 16) & 0xff g = (val >> 8) & 0xff b = val & 0xff return f"RGBColor(0x{r:02x}, 0x{g:02x}, 0x{b:02x})" new_content = re.sub(r'RGBColor\((0x[0-9a-fA-F]{6})\)', fix_rgb, content) with open("/tmp/workspace/build_pptx.py", "w") as f: f.write(new_content) print("Fixed all RGBColor calls") EOF

Running Command

python3 /tmp/workspace/build_pptx.py 2>&1

Your PowerPoint is ready! 🎉

Chapter17 MultiplePregnancy

Presentation · PPTX


Here's what's included across the 12 slides:
SlideTopicVisual Style
1Title SlideDark blue with decorative circles & accent strips
2Chapter Outline10 color-coded topic cards with icons
3Twins - Types & VarietiesSide-by-side DZ (blue) vs MZ (green) comparison boxes
4Chorionicity DiagramTimeline arrow with 4 timing boxes (D/D → D/M → M/M → Conjoined) + Lambda vs T-sign comparison
5Incidence & Risk FactorsHellin's Rule visual + horizontal bar chart for country incidence + risk factor cards
6Diagnosis of Twins4-column layout: History / Symptoms / Abdominal Exam / Investigations
7Complications DiagramCentral node with 4 satellite boxes (Maternal / Delivery / Fetal / Monochorionic-specific) + TTTS box
8Antenatal & Labour Management5-step flowchart for antenatal + 4-column labour management cards
9Amniotic Fluid DisordersTwo-panel layout — Polyhydramnios (purple) vs Oligohydramnios (red) with etiology + Potter sequence box
10Placental Abnormalities7 color-coded cards in a 2-row grid
11Cord Abnormalities9 cards in 3×3 grid + Vasa Previa highlight banner
12Quick RevisionDark background with 15 high-yield exam points in alternating colored rows

It wasn't better make me a elaborative note for depth knowledge

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
This is a shared conversation. Sign in to Orris to start your own chat.