shorten this and consise this in 5 pages

Reading File
Running Command

cd /home/daytona/workspace && python3 -c " import pdfplumber pdf_path = '/home/daytona/workspace/attachments/869ef864-0f56-44f0-8662-79e113579c9f/LTST Master HAIR FALL GUIDE MY OWN CASE gains_by_ali.pdf' with pdfplumber.open(pdf_path) as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "

Running Command

mkdir -p /home/daytona/workspace/hair-fall-guide && python3 << 'EOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY doc = SimpleDocTemplate( "/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() # Custom styles title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=20, textColor=colors.HexColor('#1a1a2e'), spaceAfter=6, alignment=TA_CENTER) subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=10, textColor=colors.HexColor('#555555'), spaceAfter=12, alignment=TA_CENTER) section_style = ParagraphStyle('Section', parent=styles['Heading1'], fontSize=13, textColor=colors.HexColor('#1a1a2e'), spaceBefore=14, spaceAfter=6, borderPad=4, backColor=colors.HexColor('#e8f0fe'), leftIndent=6, borderWidth=0) heading2_style = ParagraphStyle('Heading2', parent=styles['Heading2'], fontSize=11, textColor=colors.HexColor('#2d5016'), spaceBefore=8, spaceAfter=4) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=9.5, leading=14, spaceAfter=5, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=9.5, leading=13, leftIndent=14, spaceAfter=3) warning_style = ParagraphStyle('Warning', parent=styles['Normal'], fontSize=9, leading=13, textColor=colors.HexColor('#8b0000'), leftIndent=8, spaceAfter=5) note_style = ParagraphStyle('Note', parent=styles['Normal'], fontSize=8.5, leading=12, textColor=colors.HexColor('#555555'), leftIndent=8, spaceAfter=6, fontName='Helvetica-Oblique') story = [] # ── PAGE 1 ────────────────────────────────────────────────────────────────── story.append(Paragraph("COMPLETE HAIR FALL & REGROWTH GUIDE", title_style)) story.append(Paragraph("Evidence-Based Protocols for Scalp Health, Nutrition & Hair Restoration", subtitle_style)) story.append(Paragraph("By Muhammad Ali — Fitness & Grooming Coach | @gains_by_ali", subtitle_style)) story.append(HRFlowable(width="100%", thickness=1.5, color=colors.HexColor('#1a1a2e'), spaceAfter=10)) story.append(Paragraph("SECTION 1 — Scalp Cleansing: What Shampoo Actually Does", section_style)) story.append(Paragraph( "Shampoo is a <b>hygiene tool</b>, not a hair-loss treatment. It removes excess sebum, sweat, dust, and dead " "skin cells — creating a clean environment for follicles. However, shampoo cannot penetrate the dermis where " "follicles live, cannot block DHT, and cannot regrow lost hair (contact time is only 30–60 seconds).", body_style)) wash_data = [ ["Scalp Type", "Recommended Frequency"], ["Oily", "Daily or every other day"], ["Normal", "Every 2–3 days"], ["Dry", "2–3 times per week"], ] wash_table = Table(wash_data, colWidths=[8*cm, 8*cm]) wash_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(wash_table) story.append(Spacer(1, 6)) story.append(Paragraph( "<b>Medical shampoo</b> (Ketoconazole / Selenium Sulfide) — only use when dandruff, itching, or fungal issues are present.", note_style)) story.append(Paragraph("SECTION 2 — External Damage Factors", section_style)) ext_data = [ ["Factor", "Effect"], ["UV & Heat", "Breaks down keratin → dryness, loss of elasticity, breakage"], ["Pollution & Dust", "Clogs follicles, raises oxidative stress → chronic inflammation"], ["Over-Oiling", "Traps dust and fungi → blocked follicles, potential infections"], ["Styling Products", "Alcohol & polymer buildup → weaken hair shaft over time"], ["Wet Hair Handling", "Hydrogen bonds broken when wet — never comb aggressively"], ["Stress & Poor Sleep", "Elevated cortisol → pushes follicles into shedding (telogen) phase"], ] ext_table = Table(ext_data, colWidths=[4.5*cm, 11.5*cm]) ext_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(ext_table) # ── PAGE 2 ────────────────────────────────────────────────────────────────── story.append(Paragraph("SECTION 3 — Root Causes of Hair Fall", section_style)) story.append(Paragraph("3A. Androgenetic Alopecia (DHT Hair Loss)", heading2_style)) story.append(Paragraph( "DHT (Dihydrotestosterone) is derived from testosterone. In genetically sensitive individuals, DHT binds " "to follicle receptors and triggers <b>miniaturization</b> — follicles shrink, produce thinner/shorter " "strands, and eventually stop producing visible hair.", body_style)) story.append(Paragraph("<b>Signs:</b> Receding hairline (temples first), crown thinning, progressively thinner new hairs.", bullet_style)) story.append(Paragraph( "<b>Critical reality:</b> Oils, shampoos, and diet alone cannot stop DHT-driven loss. The cause is " "hormonal and genetic — medical treatment is required (see Section 7).", warning_style)) story.append(Paragraph("3B. Nutritional Deficiencies", heading2_style)) nut_data = [ ["Nutrient", "Role in Hair", "Optimal Level", "Dosage"], ["Vitamin D", "Activates dormant follicles; regulates growth cycle", "40–60 ng/mL", "2,000–4,000 IU/day + K2"], ["Vitamin B12", "Oxygen delivery to follicles via red blood cells", "500–900 pg/mL", "1,000 mcg/day (methylcobalamin)"], ["Iron / Ferritin", "Oxygen carrier to follicles; deficiency shuts growth cycle early", "Ferritin 50–100 ng/mL", "30–60 mg elemental iron + Vit C"], ["Zinc", "Tissue repair, oil regulation, reduces scalp inflammation", "70–100 µg/dL", "15–30 mg/day (don't overdose)"], ["Protein", "Keratin (hair) is almost entirely protein", "0.8–1 g/kg bodyweight/day", "Eggs, chicken, fish, lentils"], ] nut_table = Table(nut_data, colWidths=[3*cm, 6*cm, 3.5*cm, 3.5*cm]) nut_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('WORDWRAP', (0,0), (-1,-1), True), ])) story.append(nut_table) # ── PAGE 3 ────────────────────────────────────────────────────────────────── story.append(Paragraph("SECTION 4 — Telogen Effluvium (Temporary Hair Fall)", section_style)) te_data = [ ["Aspect", "Details"], ["What happens", "Large number of follicles simultaneously pushed into shedding phase"], ["Common triggers", "Severe stress, illness, surgery, crash dieting, major hormonal change"], ["Onset", "Shedding begins 1–2 months after the triggering event"], ["Recovery", "3–6 months of natural regrowth once trigger is resolved"], ["Reversibility", "Fully reversible — unlike androgenetic alopecia"], ["Action", "Identify and remove the trigger; support with nutrition and stress management"], ] te_table = Table(te_data, colWidths=[4.5*cm, 11.5*cm]) te_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(te_table) story.append(Paragraph("SECTION 5 — Thyroid & Hormonal Imbalances", section_style)) story.append(Paragraph( "Thyroid hormones control metabolic rate, including the hair growth cycle. Both hypothyroidism and " "hyperthyroidism cause diffuse thinning, texture changes, and slow regrowth.", body_style)) story.append(Paragraph("<b>Tests to request:</b> TSH, Free T3, Free T4", bullet_style)) story.append(Paragraph( "<b>Fix:</b> Treat the underlying thyroid condition under medical supervision — hair often recovers " "naturally once hormones are balanced.", bullet_style)) story.append(Paragraph("SECTION 6 — Oils vs. Root-Level Reality", section_style)) oil_data = [ ["Oils CAN Help With", "Oils CANNOT Do"], ["Dryness and frizz control", "Stop DHT or reverse genetic hair loss"], ["Adding surface shine", "Penetrate deep enough to reach follicle roots"], ["Hair shaft protection from breakage", "Regrow hair in bald or miniaturized areas"], ["Soothing mildly irritated scalp", "Replace medical-grade hair loss treatment"], ] oil_table = Table(oil_data, colWidths=[8*cm, 8*cm]) oil_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(oil_table) # ── PAGE 4 ────────────────────────────────────────────────────────────────── story.append(Paragraph("SECTION 7 — Minoxidil + Finasteride: Gold Standard Treatment", section_style)) story.append(Paragraph( "For androgenetic (DHT-driven) alopecia, <b>Minoxidil + Finasteride</b> is the only clinically proven " "combination. Used alone, Minoxidil results become temporary as DHT continues damaging follicles " "underneath. Together they stop loss AND regrow hair.", body_style)) drug_data = [ ["MINOXIDIL (Growth Stimulator)", "FINASTERIDE (DHT Blocker — Males Only)"], ["Increases blood flow to the scalp", "Inhibits the 5-alpha reductase enzyme"], ["Reactivates dormant follicles", "Reduces DHT levels in the scalp"], ["Extends the anagen (growth) phase", "Stops follicle miniaturization"], ["Results: thicker hair, new baby hairs, improved density", "Results: halts progression, protects existing follicles"], ["Does NOT block DHT — growth only", "NOT recommended for females"], ] drug_table = Table(drug_data, colWidths=[8*cm, 8*cm]) drug_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2d5016')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0fff0'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(drug_table) story.append(Spacer(1, 8)) story.append(Paragraph("Application: Topical (Recommended) vs. Oral", heading2_style)) story.append(Paragraph( "<b>Topical</b> — Applied directly to scalp. Lower systemic absorption = significantly fewer side effects. Best starting point.", bullet_style)) story.append(Paragraph( "<b>Oral</b> — More potent. Higher systemic side-effect risk. Use under medical supervision.", bullet_style)) story.append(Paragraph("Treatment Timeline", heading2_style)) tl_data = [ ["Timeline", "What to Expect"], ["Months 1–2", "Initial shedding phase — old weak hairs fall to make room. This is NORMAL."], ["Months 3–4", "Baby hairs appear. Hairline and crown show early improvement."], ["Month 6", "Clearly visible improvement in density and thickness."], ["Month 12", "Strong, consolidated results. Full evaluation point."], ["Long-term", "Minimum 6–12 months commitment. Ideal: ongoing maintenance."], ] tl_table = Table(tl_data, colWidths=[4*cm, 12*cm]) tl_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(tl_table) story.append(Paragraph( "IMPORTANT: Stopping treatment causes hair to gradually revert as DHT resumes its effect. " "This is a long-term maintenance program.", warning_style)) story.append(Paragraph("Personal Case — Muhammad Ali (@gains_by_ali)", heading2_style)) case_data = [ ["Condition", "Severe DHT sensitivity — receding hairline (Androgenetic Alopecia)"], ["Treatment Used", "Minoxidil + Finasteride (topical and oral forms)"], ["Formulation", "Minoxidil 8%, Finasteride 0.25%, Zinc, Biotin, Caffeine, Tretinoin"], ["Application", "Directly to scalp — twice daily"], ["Visible Results", "Improvement at 3–4 months; strong results at 6–12 months"], ] case_table = Table(case_data, colWidths=[4.5*cm, 11.5*cm]) case_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,-1), colors.HexColor('#e8f0fe')), ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(case_table) # ── PAGE 5 ────────────────────────────────────────────────────────────────── story.append(Paragraph("SECTION 8 — Daily Habits That Maximize Results", section_style)) habits_data = [ ["#", "Habit", "Why It Matters"], ["1", "Sleep 7–8 hrs nightly", "Growth hormone released in deep sleep directly stimulates follicle repair"], ["2", "Exercise daily", "Improves circulation — better blood flow = more nutrients to follicles"], ["3", "Adequate protein", "Hair is keratin (protein). Low protein = breakage and shedding"], ["4", "Fix micronutrient deficiencies", "Test and supplement Vitamin D, B12, Iron, and Zinc"], ["5", "Stay well hydrated", "Dehydration affects scalp elasticity and hair shaft moisture balance"], ["6", "Keep scalp clean", "Prevents follicle blockage, microbial overgrowth, inflammation-driven shedding"], ["7", "Manage stress", "High cortisol triggers Telogen Effluvium — chronic stress accelerates fall"], ] habits_table = Table(habits_data, colWidths=[1*cm, 5.5*cm, 9.5*cm]) habits_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(habits_table) story.append(Paragraph("FINAL SUMMARY — The Complete Hair Loss Framework", section_style)) summary_data = [ ["WHAT WORKS (Evidence-Based)", "WHAT WON'T WORK for Genetic Loss"], ["Minoxidil + Finasteride (proven)", "Oils — surface-only, cannot reach follicle roots"], ["Correcting nutritional deficiencies (D, B12, Fe, Zn)", "Shampoos alone — no follicle-level effect"], ["Managing stress and improving sleep", "Hair masks / DIY remedies"], ["Clean scalp — prevents acceleration of shedding", "Ignoring DHT while only using Minoxidil"], ["Treating underlying thyroid/hormone issues", "Expecting visible results in under 3 months"], ] summary_table = Table(summary_data, colWidths=[8*cm, 8*cm]) summary_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0fff0'), colors.HexColor('#fff0f0')]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(summary_table) story.append(Spacer(1, 10)) story.append(Paragraph( "Hair fall is not random — it is a biological signal. Identify the real cause, address it with the right " "tool, stay consistent, and results follow. If the cause is genetic DHT sensitivity, only proven medical " "treatment will stop and reverse it. Everything else supports the journey.", body_style)) story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#cccccc'), spaceBefore=10, spaceAfter=8)) story.append(Paragraph( "<b>Disclaimer:</b> This document is for educational purposes only. The author is not a licensed doctor. " "Always consult a qualified healthcare professional before starting any supplement, medication, or " "treatment protocol. Results vary by individual.", note_style)) story.append(Paragraph("— Muhammad Ali | @gains_by_ali | Fitness & Grooming Coach", subtitle_style)) doc.build(story) print("PDF created successfully!") EOF

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf') print(f'Total pages: {len(r.pages)}') "

Running Command

python3 << 'EOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY doc = SimpleDocTemplate( "/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=22, textColor=colors.HexColor('#1a1a2e'), spaceAfter=4, alignment=TA_CENTER) subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=10, textColor=colors.HexColor('#555555'), spaceAfter=8, alignment=TA_CENTER) section_style = ParagraphStyle('Section', parent=styles['Heading1'], fontSize=12, textColor=colors.white, spaceBefore=12, spaceAfter=6, backColor=colors.HexColor('#1a1a2e'), leftIndent=6, rightIndent=6, borderPad=5) heading2_style = ParagraphStyle('Heading2', parent=styles['Heading2'], fontSize=10.5, textColor=colors.HexColor('#1a1a2e'), spaceBefore=8, spaceAfter=4) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=9.5, leading=14, spaceAfter=5, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=9.5, leading=13, leftIndent=14, spaceAfter=3) warning_style = ParagraphStyle('Warning', parent=styles['Normal'], fontSize=9, leading=13, textColor=colors.HexColor('#8b0000'), leftIndent=8, spaceAfter=6, fontName='Helvetica-Bold') note_style = ParagraphStyle('Note', parent=styles['Normal'], fontSize=8.5, leading=12, textColor=colors.HexColor('#555555'), spaceAfter=6, fontName='Helvetica-Oblique') keybox_style = ParagraphStyle('Keybox', parent=styles['Normal'], fontSize=9, leading=13, textColor=colors.HexColor('#2d5016'), leftIndent=8, spaceAfter=6, fontName='Helvetica-Bold', borderPad=4, backColor=colors.HexColor('#e8ffe8')) def make_table(data, col_widths, header_color='#1a1a2e', row_colors=None): if row_colors is None: row_colors = [colors.HexColor('#f0f4ff'), colors.white] t = Table(data, colWidths=col_widths) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor(header_color)), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), row_colors), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) return t story = [] # ══════════════════════════════════════════════════════════════════════════════ # PAGE 1 — Title + Sections 1 & 2 # ══════════════════════════════════════════════════════════════════════════════ story.append(Spacer(1, 0.5*cm)) story.append(Paragraph("COMPLETE HAIR FALL & REGROWTH GUIDE", title_style)) story.append(Paragraph("Evidence-Based Protocols for Scalp Health, Nutrition & Hair Restoration", subtitle_style)) story.append(Paragraph("By Muhammad Ali — Fitness &amp; Grooming Coach | @gains_by_ali", subtitle_style)) story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a1a2e'), spaceAfter=10)) # TOC box toc_data = [ ["WHAT THIS GUIDE COVERS"], ["1. Scalp Cleansing — What Shampoo Actually Does (& Doesn't Do)"], ["2. External Damage Factors — Why Hair Weakens"], ["3. Root Causes of Hair Fall — DHT & Nutritional Deficiencies"], ["4. Telogen Effluvium — Temporary Hair Fall Explained"], ["5. Thyroid & Hormonal Issues"], ["6. Oils vs. Root-Level Reality"], ["7. Minoxidil + Finasteride — The Only Proven Solution for Genetic Hair Loss"], ["8. Daily Habits That Maximize Results + Final Summary"], ] toc_table = Table(toc_data, colWidths=[16*cm]) toc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 9), ('BACKGROUND', (0,1), (-1,-1), colors.HexColor('#f5f7ff')), ('TEXTCOLOR', (0,1), (-1,-1), colors.HexColor('#1a1a2e')), ('GRID', (0,0), (-1,-1), 0.3, colors.HexColor('#cccccc')), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,1), (-1,-1), 12), ])) story.append(toc_table) story.append(Spacer(1, 10)) story.append(Paragraph("SECTION 1 — Scalp Cleansing: What Shampoo Actually Does", section_style)) story.append(Paragraph( "Shampoo is a <b>hygiene tool</b>, not a hair-loss treatment. It removes excess sebum, sweat, dust, " "and dead skin cells — creating a clean environment for follicles. However, shampoo cannot penetrate " "the dermis (where follicles live), cannot block DHT, and cannot regrow lost hair. Contact time is " "only 30–60 seconds — too brief for any follicle-level action.", body_style)) wash_data = [ ["Scalp Type", "Recommended Wash Frequency", "Shampoo Type"], ["Oily", "Daily or every other day", "Regular or clarifying"], ["Normal", "Every 2–3 days", "Regular"], ["Dry", "2–3 times per week", "Hydrating (biotin/keratin)"], ["Dandruff/Fungal", "As needed", "Medical: Ketoconazole / Selenium Sulfide"], ] story.append(make_table(wash_data, [4*cm, 6*cm, 6*cm])) story.append(Paragraph( "Key takeaway: A clean scalp prevents follicle blockage and microbial inflammation — which accelerates " "shedding in already-vulnerable follicles. Shampoo is a support system, not a cure.", keybox_style)) story.append(Paragraph("SECTION 2 — External Damage Factors", section_style)) ext_data = [ ["Factor", "Effect on Hair & Scalp"], ["UV & Heat", "Breaks down keratin (structural protein) → dryness, lost elasticity, breakage"], ["Pollution & Dust", "Microparticles clog follicles, raise oxidative stress, trigger chronic inflammation"], ["Over-Oiling", "Oils trap dust and fungi → blocked follicles, potential infections"], ["Styling Products", "Alcohol & polymer buildup from gels/sprays/wax gradually weakens the hair shaft"], ["Wet Hair Handling", "Hydrogen bonds break when wet — hair stretches and snaps; never comb aggressively"], ["Stress & Poor Sleep", "Elevated cortisol prematurely pushes follicles into telogen (shedding) phase"], ] story.append(make_table(ext_data, [4.5*cm, 11.5*cm])) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 2 — Section 3: Root Causes (DHT + Nutrition) # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 3A — Androgenetic Alopecia (DHT Hair Loss)", section_style)) story.append(Paragraph( "DHT (Dihydrotestosterone) is derived from testosterone. In genetically sensitive individuals, DHT binds " "to follicle receptors and triggers <b>miniaturization</b> — follicles progressively shrink, producing " "thinner and shorter strands, until they stop producing visible hair entirely.", body_style)) dht_data = [ ["Sign", "Description"], ["Receding hairline", "Temples thin first — classic M-shaped recession"], ["Crown thinning", "Hair density reduces in a circular patch at the top"], ["Progressive thinning", "Each new hair generation is noticeably thinner than the last"], ] story.append(make_table(dht_data, [5*cm, 11*cm])) story.append(Paragraph( "Critical reality: Oils, shampoos, and diet CANNOT stop DHT-driven loss. The cause is hormonal and " "genetic — medical treatment (Section 7) is required.", warning_style)) story.append(Spacer(1, 6)) story.append(Paragraph("SECTION 3B — Nutritional Deficiencies", section_style)) story.append(Paragraph( "Deficiencies in key micronutrients are among the most common — and most overlooked — causes of hair " "fall. Get a blood test before supplementing, and target optimal (not just 'normal') levels.", body_style)) nut_data = [ ["Nutrient", "Role in Hair Growth", "Optimal Level", "Recommended Dosage"], ["Vitamin D", "Activates dormant follicles; regulates growth cycle", "40–60 ng/mL", "2,000–4,000 IU/day + K2"], ["Vitamin B12", "Oxygen delivery to follicles via red blood cells", "500–900 pg/mL", "1,000 mcg/day (methylcobalamin)"], ["Iron / Ferritin", "Carries oxygen to follicles; low ferritin shuts down growth cycle early", "Ferritin: 50–100 ng/mL", "30–60 mg elemental iron + Vit C"], ["Zinc", "Tissue repair, oil gland regulation, reduces scalp inflammation", "70–100 µg/dL", "15–30 mg/day (avoid excess — depletes copper)"], ["Protein", "Hair is almost entirely keratin (a protein); essential for strand structure", "0.8–1 g/kg bodyweight/day", "Eggs, chicken, fish, lentils, legumes"], ] nut_table = Table(nut_data, colWidths=[3*cm, 5.5*cm, 3.5*cm, 4*cm]) nut_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(nut_table) story.append(Spacer(1, 8)) story.append(Paragraph( "Tip: Vitamin D and Iron deficiencies are extremely common, especially in people with indoor lifestyles " "or in females. Always test before supplementing and aim for optimal (not just normal range) values.", note_style)) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 3 — Sections 4, 5, 6 # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 4 — Telogen Effluvium: Temporary Hair Fall", section_style)) story.append(Paragraph( "Telogen Effluvium occurs when a large number of follicles are simultaneously pushed into the shedding " "(telogen) phase. Unlike genetic hair loss, this condition is <b>fully reversible</b>.", body_style)) te_data = [ ["Aspect", "Details"], ["What happens", "Mass exit from growth phase into shedding — diffuse all-over hair loss"], ["Common triggers", "Severe stress, illness/infection, surgery, crash dieting, major hormonal change"], ["Onset", "Shedding begins 1–2 months after the triggering event"], ["Recovery", "3–6 months of natural regrowth once the trigger is resolved"], ["Reversibility", "Fully reversible — unlike androgenetic alopecia (permanent without treatment)"], ["Action required", "Identify and eliminate the trigger; support with nutrition and stress management"], ] story.append(make_table(te_data, [4.5*cm, 11.5*cm])) story.append(Paragraph("SECTION 5 — Thyroid &amp; Hormonal Imbalances", section_style)) story.append(Paragraph( "Thyroid hormones govern the body's metabolic rate, including the speed and quality of the hair growth " "cycle. Both hypothyroidism and hyperthyroidism cause noticeable hair changes.", body_style)) thyroid_data = [ ["Tests to Request", "Effects of Imbalance", "Fix Protocol"], ["TSH, Free T3, Free T4", "Diffuse thinning, texture changes (hair becomes dry/brittle or limp), slow regrowth", "Treat the underlying thyroid condition under medical supervision — hair often recovers naturally once hormones are balanced"], ] thyroid_table = Table(thyroid_data, colWidths=[4*cm, 6*cm, 6*cm]) thyroid_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('BACKGROUND', (0,1), (-1,-1), colors.HexColor('#f0f4ff')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(thyroid_table) story.append(Paragraph("SECTION 6 — Oils vs. Root-Level Reality", section_style)) story.append(Paragraph( "Oils are applied to the epidermis (outer skin layer), but hair follicle roots live in the dermis " "(deeper layer). Oils cannot penetrate deeply enough to influence follicle biology.", body_style)) oil_data = [ ["Oils CAN Help With", "Oils CANNOT Do"], ["Dryness and frizz control", "Stop DHT or reverse genetic hair loss"], ["Adding surface shine and softness", "Penetrate deep enough to reach follicle roots"], ["Protecting hair shaft from breakage", "Regrow hair in bald or miniaturized areas"], ["Soothing a mildly irritated scalp", "Replace medical-grade hair loss treatment"], ] oil_table = Table(oil_data, colWidths=[8*cm, 8*cm]) oil_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('BACKGROUND', (0,1), (0,-1), colors.HexColor('#e8ffe8')), ('BACKGROUND', (1,1), (1,-1), colors.HexColor('#ffe8e8')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(oil_table) story.append(Paragraph( "Bottom line: Oils are a cosmetic tool. For genetic or hormonal hair loss, they provide no therapeutic benefit at the follicle level.", note_style)) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 4 — Section 7: Minoxidil + Finasteride # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 7 — Minoxidil + Finasteride: The Gold Standard", section_style)) story.append(Paragraph( "For androgenetic (DHT-driven) alopecia, <b>Minoxidil combined with Finasteride</b> is the only " "clinically proven solution. Without treatment, androgenetic alopecia progresses continuously and " "permanently. Used alone, Minoxidil results become temporary as DHT continues damaging follicles " "underneath. Together they stop loss AND stimulate regrowth.", body_style)) drug_data = [ ["MINOXIDIL — Growth Stimulator", "FINASTERIDE — DHT Blocker (Males Only)"], ["Increases blood flow to the scalp", "Inhibits the 5-alpha reductase enzyme"], ["Reactivates dormant follicles", "Reduces DHT levels in scalp tissue"], ["Extends the anagen (growth) phase", "Halts follicle miniaturization"], ["Results: thicker hair, new baby hairs, improved density", "Results: stops progression, protects existing follicles"], ["Does NOT block DHT — growth effect only", "NOT recommended for females"], ] drug_table = Table(drug_data, colWidths=[8*cm, 8*cm]) drug_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2d5016')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0fff0'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(drug_table) story.append(Spacer(1, 8)) admin_data = [ ["Administration", "Pros / Cons"], ["Topical (Recommended)", "Applied directly to scalp. Lower systemic absorption = significantly fewer side effects. Best starting point for most users."], ["Oral", "More potent systemic effect. Higher risk of systemic side effects. Best used under medical supervision."], ] story.append(make_table(admin_data, [4.5*cm, 11.5*cm])) story.append(Spacer(1, 8)) tl_data = [ ["Timeline", "What to Expect"], ["Months 1–2", "Initial shedding — old weak hairs fall to make room for stronger ones. This is NORMAL."], ["Months 3–4", "Baby hairs begin appearing. Hairline and crown show early improvement."], ["Month 6", "Clearly visible improvement in density and thickness."], ["Month 12", "Strong, consolidated results. Full evaluation point."], ["Long-term", "Ongoing maintenance required. Stopping causes gradual reversion as DHT resumes effect."], ] story.append(make_table(tl_data, [3.5*cm, 12.5*cm])) story.append(Paragraph( "Stopping treatment: If Minoxidil/Finasteride is discontinued, hair will gradually revert to its previous " "state as DHT resumes its effect on follicles. This is a long-term maintenance program.", warning_style)) story.append(Paragraph("Personal Case — Muhammad Ali (@gains_by_ali)", heading2_style)) case_data = [ ["Condition", "Severe DHT sensitivity — receding hairline (Androgenetic Alopecia)"], ["Treatment Used", "Minoxidil + Finasteride (both topical and oral forms)"], ["Formulation Used", "Minoxidil 8%, Finasteride 0.25%, Zinc, Biotin, Caffeine, Tretinoin"], ["Application", "Applied directly to scalp — twice daily"], ["Visible Results", "Improvement beginning at 3–4 months; strong consolidated results at 6–12 months"], ["Note", "This is not a sponsorship — the author discloses personal use only. Always do your own research and consult a doctor before starting any medication."], ] case_table = Table(case_data, colWidths=[4*cm, 12*cm]) case_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,-1), colors.HexColor('#e8f0fe')), ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(case_table) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 5 — Section 8 + Final Summary + Disclaimer # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 8 — Daily Habits That Maximize Results", section_style)) habits_data = [ ["#", "Habit", "Why It Matters for Hair"], ["1", "Sleep 7–8 hours nightly", "Growth hormone is released during deep sleep — directly stimulates follicle activity and repair"], ["2", "Exercise daily", "Improves circulation; better scalp blood flow = more nutrients delivered to follicles"], ["3", "Eat adequate protein", "Hair is made of keratin (protein). Low protein = structural weakness, breakage, and shedding"], ["4", "Fix micronutrient deficiencies", "Test and supplement Vitamin D, B12, Iron, and Zinc to optimal levels"], ["5", "Stay well hydrated", "Dehydration affects scalp elasticity and the moisture balance of the hair shaft"], ["6", "Keep the scalp clean", "Prevents follicle blockage, microbial overgrowth, and inflammation-driven shedding"], ["7", "Manage stress actively", "Chronic high cortisol triggers Telogen Effluvium — a direct cause of accelerated hair fall"], ] habits_table = Table(habits_data, colWidths=[0.8*cm, 5.2*cm, 10*cm]) habits_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(habits_table) story.append(Spacer(1, 12)) story.append(Paragraph("FINAL SUMMARY — The Complete Hair Loss Framework", section_style)) summary_data = [ ["WHAT WORKS (Evidence-Based)", "WHAT WON'T WORK for Genetic Loss"], ["Minoxidil + Finasteride (clinically proven)", "Oils — surface-only, cannot reach follicle roots"], ["Correcting deficiencies: Vit D, B12, Iron, Zinc", "Shampoos alone — no follicle-level effect"], ["Adequate protein intake (0.8–1 g/kg/day)", "Hair masks and DIY home remedies"], ["Managing stress + improving sleep quality", "Using Minoxidil without blocking DHT"], ["Keeping the scalp clean to prevent inflammation", "Expecting visible results in under 3 months"], ["Treating underlying thyroid/hormonal issues", "Ignoring the root biological cause"], ] summary_table = Table(summary_data, colWidths=[8*cm, 8*cm]) summary_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('BACKGROUND', (0,1), (0,-1), colors.HexColor('#e8ffe8')), ('BACKGROUND', (1,1), (1,-1), colors.HexColor('#ffe8e8')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(summary_table) story.append(Spacer(1, 12)) story.append(Paragraph( "Hair fall is not random — it is a biological signal. Identify the real cause, address it with the right " "tool, stay consistent, and results follow. If the cause is genetic DHT sensitivity, only proven medical " "treatment will stop and reverse it. Everything else supports the journey — it cannot replace the foundation.", body_style)) story.append(Spacer(1, 14)) story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#cccccc'), spaceAfter=8)) story.append(Paragraph( "<b>Disclaimer:</b> This document is for educational and informational purposes only. The author " "(Muhammad Ali / @gains_by_ali) is not a licensed doctor, dermatologist, or medical professional. " "Nothing in this guide constitutes medical advice, diagnosis, or treatment. Always consult a qualified " "healthcare professional before starting any supplement, medication, or treatment protocol. Results vary " "by individual. Stop any product immediately if adverse effects occur.", note_style)) story.append(Spacer(1, 8)) story.append(Paragraph("— Muhammad Ali | @gains_by_ali | Fitness &amp; Grooming Coach", subtitle_style)) doc.build(story) print("Done!") EOF

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf') print(f'Total pages: {len(r.pages)}') "

Running Command

python3 << 'EOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import cm from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY doc = SimpleDocTemplate( "/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf", pagesize=A4, rightMargin=2*cm, leftMargin=2*cm, topMargin=1.8*cm, bottomMargin=1.8*cm ) styles = getSampleStyleSheet() title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=21, textColor=colors.HexColor('#1a1a2e'), spaceAfter=3, alignment=TA_CENTER) subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=9.5, textColor=colors.HexColor('#555555'), spaceAfter=6, alignment=TA_CENTER) section_style = ParagraphStyle('Section', parent=styles['Heading1'], fontSize=11.5, textColor=colors.white, spaceBefore=10, spaceAfter=5, backColor=colors.HexColor('#1a1a2e'), leftIndent=6, rightIndent=6, borderPad=4) heading2_style = ParagraphStyle('Heading2', parent=styles['Heading2'], fontSize=10, textColor=colors.HexColor('#1a1a2e'), spaceBefore=6, spaceAfter=3) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=9, leading=13, spaceAfter=4, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=9, leading=12, leftIndent=14, spaceAfter=3) warning_style = ParagraphStyle('Warning', parent=styles['Normal'], fontSize=8.5, leading=12, textColor=colors.HexColor('#8b0000'), leftIndent=8, spaceAfter=5, fontName='Helvetica-Bold') note_style = ParagraphStyle('Note', parent=styles['Normal'], fontSize=8, leading=11, textColor=colors.HexColor('#555555'), spaceAfter=5, fontName='Helvetica-Oblique') keybox_style = ParagraphStyle('Keybox', parent=styles['Normal'], fontSize=8.5, leading=12, textColor=colors.HexColor('#2d5016'), leftIndent=8, spaceAfter=5, fontName='Helvetica-Bold') def make_table(data, col_widths, header_color='#1a1a2e', row_colors=None, fontsize=8.5, pad=4): if row_colors is None: row_colors = [colors.HexColor('#f0f4ff'), colors.white] t = Table(data, colWidths=col_widths) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor(header_color)), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), fontsize), ('ROWBACKGROUNDS', (0,1), (-1,-1), row_colors), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), pad), ('BOTTOMPADDING', (0,0), (-1,-1), pad), ])) return t story = [] # ══════════════════════════════════════════════════════════════════════════════ # PAGE 1 — Title + Sections 1 & 2 # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("COMPLETE HAIR FALL &amp; REGROWTH GUIDE", title_style)) story.append(Paragraph("Evidence-Based Protocols for Scalp Health, Nutrition &amp; Hair Restoration", subtitle_style)) story.append(Paragraph("By Muhammad Ali — Fitness &amp; Grooming Coach | @gains_by_ali", subtitle_style)) story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a1a2e'), spaceAfter=8)) toc_data = [ ["WHAT THIS GUIDE COVERS"], ["1. Scalp Cleansing | 2. External Damage Factors | 3. Root Causes (DHT + Nutrition)"], ["4. Telogen Effluvium | 5. Thyroid & Hormonal Issues | 6. Oils vs. Reality"], ["7. Minoxidil + Finasteride (Gold Standard Treatment) | 8. Daily Habits + Final Summary"], ] toc_table = Table(toc_data, colWidths=[16*cm]) toc_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8.5), ('BACKGROUND', (0,1), (-1,-1), colors.HexColor('#f5f7ff')), ('GRID', (0,0), (-1,-1), 0.3, colors.HexColor('#cccccc')), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ('LEFTPADDING', (0,1), (-1,-1), 10), ('ALIGN', (0,1), (-1,-1), 'CENTER'), ])) story.append(toc_table) story.append(Spacer(1, 6)) story.append(Paragraph("SECTION 1 — Scalp Cleansing: What Shampoo Actually Does", section_style)) story.append(Paragraph( "Shampoo is a <b>hygiene tool</b>, not a hair-loss treatment. It removes excess sebum, sweat, dust, and dead " "skin cells — creating a clean environment for follicles. It cannot penetrate the dermis (where follicles live), " "block DHT, or regrow lost hair. Contact time is only 30–60 seconds — too brief for follicle-level action.", body_style)) wash_data = [ ["Scalp Type", "Wash Frequency", "Shampoo Type"], ["Oily", "Daily or every other day", "Regular or clarifying"], ["Normal", "Every 2–3 days", "Regular"], ["Dry", "2–3 times per week", "Hydrating (biotin/keratin)"], ["Dandruff/Fungal", "As needed", "Ketoconazole / Selenium Sulfide"], ] story.append(make_table(wash_data, [4*cm, 6*cm, 6*cm], fontsize=8)) story.append(Paragraph( "Key takeaway: A clean scalp prevents follicle blockage and microbial inflammation. Shampoo is a support system, not a cure.", keybox_style)) story.append(Paragraph("SECTION 2 — External Damage Factors", section_style)) ext_data = [ ["Factor", "Effect on Hair &amp; Scalp"], ["UV &amp; Heat", "Breaks down keratin → dryness, lost elasticity, breakage"], ["Pollution &amp; Dust", "Clog follicles, raise oxidative stress, trigger chronic inflammation"], ["Over-Oiling", "Traps dust and fungi → blocked follicles, potential infections"], ["Styling Products", "Alcohol &amp; polymer buildup from gels/sprays weakens the hair shaft"], ["Wet Hair Handling", "Hydrogen bonds break when wet — never comb aggressively"], ["Stress &amp; Poor Sleep", "Elevated cortisol prematurely pushes follicles into telogen (shedding) phase"], ] story.append(make_table(ext_data, [4*cm, 12*cm], fontsize=8)) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 2 — Section 3: Root Causes (DHT + Nutrition) # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 3A — Androgenetic Alopecia (DHT Hair Loss)", section_style)) story.append(Paragraph( "DHT (Dihydrotestosterone) is derived from testosterone. In genetically sensitive individuals, DHT binds " "to follicle receptors and triggers <b>miniaturization</b> — follicles shrink progressively, producing thinner " "and shorter strands, until they stop producing visible hair entirely.", body_style)) dht_data = [ ["Sign", "Description"], ["Receding hairline", "Temples thin first — classic M-shaped recession"], ["Crown thinning", "Hair density reduces in a circular patch at the top"], ["Progressive thinning", "Each new hair generation is noticeably thinner than the last"], ] story.append(make_table(dht_data, [5*cm, 11*cm], fontsize=8)) story.append(Paragraph( "Critical: Oils, shampoos, and diet CANNOT stop DHT-driven loss. The cause is hormonal and genetic — medical treatment (Section 7) is required.", warning_style)) story.append(Paragraph("SECTION 3B — Nutritional Deficiencies", section_style)) story.append(Paragraph( "Deficiencies in key micronutrients are among the most common and most overlooked causes of hair fall. " "Always test blood levels before supplementing and aim for optimal (not just 'normal') values.", body_style)) nut_data = [ ["Nutrient", "Role in Hair Growth", "Optimal Level", "Dosage"], ["Vitamin D", "Activates dormant follicles; regulates growth cycle", "40–60 ng/mL", "2,000–4,000 IU/day + K2"], ["Vitamin B12", "Oxygen delivery to follicles via red blood cells", "500–900 pg/mL", "1,000 mcg/day (methylcobalamin)"], ["Iron / Ferritin", "Carries oxygen to follicles; low ferritin shuts down growth cycle early", "Ferritin: 50–100 ng/mL", "30–60 mg elemental iron + Vit C"], ["Zinc", "Tissue repair, oil gland regulation, reduces scalp inflammation", "70–100 µg/dL", "15–30 mg/day (avoid excess)"], ["Protein", "Hair is almost entirely keratin (a protein); essential for strand strength", "0.8–1 g/kg/day", "Eggs, chicken, fish, lentils"], ] nut_table = Table(nut_data, colWidths=[3*cm, 5.5*cm, 3.5*cm, 4*cm]) nut_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(nut_table) story.append(Paragraph("Tip: Vitamin D and Iron deficiencies are extremely common in people with indoor lifestyles and in females.", note_style)) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 3 — Sections 4, 5, 6 # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 4 — Telogen Effluvium: Temporary Hair Fall", section_style)) story.append(Paragraph( "Telogen Effluvium occurs when a large number of follicles are simultaneously pushed into the shedding " "(telogen) phase. Unlike genetic hair loss, this condition is <b>fully reversible</b> once the trigger is removed.", body_style)) te_data = [ ["Aspect", "Details"], ["What happens", "Mass exit of follicles from growth phase into shedding — diffuse all-over hair loss"], ["Common triggers", "Severe stress, illness/infection, surgery, crash dieting, major hormonal change"], ["Onset", "Shedding begins 1–2 months after the triggering event"], ["Recovery", "3–6 months of natural regrowth once the trigger is resolved"], ["Action required", "Identify and eliminate the trigger; support with nutrition and stress management"], ] story.append(make_table(te_data, [4*cm, 12*cm], fontsize=8)) story.append(Paragraph("SECTION 5 — Thyroid &amp; Hormonal Imbalances", section_style)) story.append(Paragraph( "Thyroid hormones govern metabolic rate, including the hair growth cycle. Both hypothyroidism and " "hyperthyroidism cause diffuse thinning, texture changes, and slow regrowth.", body_style)) thyroid_data = [ ["Tests to Request", "Effects of Imbalance", "Fix Protocol"], ["TSH, Free T3, Free T4", "Diffuse thinning, hair becomes dry/brittle or limp, slow regrowth", "Treat underlying thyroid condition under medical supervision — hair often recovers naturally once hormones balance"], ] thyroid_table = Table(thyroid_data, colWidths=[3.8*cm, 5.8*cm, 6.4*cm]) thyroid_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('BACKGROUND', (0,1), (-1,-1), colors.HexColor('#f0f4ff')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(thyroid_table) story.append(Paragraph("SECTION 6 — Oils vs. Root-Level Reality", section_style)) story.append(Paragraph( "Oils are applied to the epidermis (outer skin layer), but follicle roots live in the dermis (deeper layer). " "Oils cannot penetrate deeply enough to influence follicle biology.", body_style)) oil_data = [ ["Oils CAN Help With", "Oils CANNOT Do"], ["Dryness and frizz control", "Stop DHT or reverse genetic hair loss"], ["Surface shine and softness", "Penetrate deep enough to reach follicle roots"], ["Protecting hair shaft from breakage", "Regrow hair in bald or miniaturized areas"], ["Soothing a mildly irritated scalp", "Replace medical-grade hair loss treatment"], ] oil_table = Table(oil_data, colWidths=[8*cm, 8*cm]) oil_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('BACKGROUND', (0,1), (0,-1), colors.HexColor('#e8ffe8')), ('BACKGROUND', (1,1), (1,-1), colors.HexColor('#ffe8e8')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(oil_table) story.append(Paragraph( "Bottom line: Oils are a cosmetic tool only. For genetic or hormonal hair loss they provide no therapeutic benefit at the follicle level.", note_style)) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 4 — Section 7: Minoxidil + Finasteride (Gold Standard) # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 7 — Minoxidil + Finasteride: The Gold Standard", section_style)) story.append(Paragraph( "For androgenetic (DHT-driven) alopecia, <b>Minoxidil combined with Finasteride</b> is the only clinically " "proven solution. Used alone, Minoxidil results become temporary as DHT continues damaging follicles. " "Together they stop loss AND stimulate regrowth — Minoxidil = GROWTH, Finasteride = PROTECTION.", body_style)) drug_data = [ ["MINOXIDIL — Growth Stimulator", "FINASTERIDE — DHT Blocker (Males Only)"], ["Increases blood flow to the scalp", "Inhibits 5-alpha reductase enzyme"], ["Reactivates dormant follicles; extends anagen phase", "Reduces DHT levels; halts follicle miniaturization"], ["Results: thicker hair, new baby hairs, improved density", "Results: stops progression, protects existing follicles"], ["Does NOT block DHT — growth effect only", "NOT recommended for females"], ] drug_table = Table(drug_data, colWidths=[8*cm, 8*cm]) drug_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#2d5016')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0fff0'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(drug_table) story.append(Spacer(1, 5)) admin_data = [ ["Administration", "Notes"], ["Topical (Recommended)", "Applied to scalp. Lower systemic absorption = far fewer side effects. Best starting point for most users."], ["Oral", "More potent. Higher systemic side-effect risk. Use under medical supervision only."], ] story.append(make_table(admin_data, [4.5*cm, 11.5*cm], fontsize=8)) tl_data = [ ["Timeline", "What to Expect"], ["Months 1–2", "Initial shedding — old weak hairs fall to make room. NORMAL."], ["Months 3–4", "Baby hairs appear. Hairline and crown show early improvement."], ["Month 6", "Clearly visible improvement in density and thickness."], ["Month 12", "Strong, consolidated results. Full evaluation point."], ["Long-term", "Ongoing maintenance required. Stopping causes gradual reversion as DHT resumes."], ] story.append(make_table(tl_data, [3.5*cm, 12.5*cm], fontsize=8)) story.append(Paragraph( "Stopping treatment: Hair gradually reverts to its previous state as DHT resumes effect on follicles. This is a lifelong maintenance program.", warning_style)) story.append(Paragraph("Personal Case — Muhammad Ali (@gains_by_ali)", heading2_style)) case_data = [ ["Condition", "Severe DHT sensitivity — receding hairline (Androgenetic Alopecia)"], ["Treatment Used", "Minoxidil + Finasteride (topical &amp; oral forms)"], ["Formulation", "Minoxidil 8%, Finasteride 0.25%, Zinc, Biotin, Caffeine, Tretinoin"], ["Application", "Applied to scalp — twice daily"], ["Results", "Visible improvement at 3–4 months; strong results at 6–12 months"], ["Note", "Personal use disclosure only — not a sponsorship. Consult a doctor before starting any medication."], ] case_table = Table(case_data, colWidths=[3.5*cm, 12.5*cm]) case_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (0,-1), colors.HexColor('#e8f0fe')), ('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 4), ('BOTTOMPADDING', (0,0), (-1,-1), 4), ])) story.append(case_table) story.append(PageBreak()) # ══════════════════════════════════════════════════════════════════════════════ # PAGE 5 — Section 8 + Final Summary + Disclaimer # ══════════════════════════════════════════════════════════════════════════════ story.append(Paragraph("SECTION 8 — Daily Habits That Maximize Results", section_style)) habits_data = [ ["#", "Habit", "Why It Matters for Hair"], ["1", "Sleep 7–8 hours nightly", "Growth hormone released in deep sleep directly stimulates follicle repair"], ["2", "Exercise daily", "Better circulation = more nutrients delivered to scalp follicles"], ["3", "Adequate protein intake", "Hair is keratin (protein). Low protein = breakage and shedding"], ["4", "Fix micronutrient deficiencies", "Test and supplement Vitamin D, B12, Iron, and Zinc to optimal levels"], ["5", "Stay well hydrated", "Dehydration affects scalp elasticity and hair shaft moisture balance"], ["6", "Keep the scalp clean", "Prevents follicle blockage, microbial overgrowth, inflammation-driven shedding"], ["7", "Manage stress actively", "Chronic high cortisol triggers Telogen Effluvium — direct cause of accelerated fall"], ] habits_table = Table(habits_data, colWidths=[0.8*cm, 5*cm, 10.2*cm]) habits_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f4ff'), colors.white]), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('ALIGN', (0,0), (0,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(habits_table) story.append(Spacer(1, 8)) story.append(Paragraph("FINAL SUMMARY — The Complete Hair Loss Framework", section_style)) summary_data = [ ["WHAT WORKS (Evidence-Based)", "WHAT WON'T WORK for Genetic Loss"], ["Minoxidil + Finasteride (clinically proven)", "Oils — surface-only, cannot reach follicle roots"], ["Correcting deficiencies: Vit D, B12, Iron, Zinc", "Shampoos alone — no follicle-level effect"], ["Adequate protein (0.8–1 g/kg/day)", "Hair masks and DIY home remedies"], ["Managing stress + improving sleep quality", "Using Minoxidil alone without blocking DHT"], ["Clean scalp to prevent inflammation", "Expecting visible results in under 3 months"], ["Treating underlying thyroid/hormonal issues", "Ignoring the root biological cause"], ] summary_table = Table(summary_data, colWidths=[8*cm, 8*cm]) summary_table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a1a2e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTSIZE', (0,0), (-1,-1), 8), ('BACKGROUND', (0,1), (0,-1), colors.HexColor('#e8ffe8')), ('BACKGROUND', (1,1), (1,-1), colors.HexColor('#ffe8e8')), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#cccccc')), ('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('TOPPADDING', (0,0), (-1,-1), 5), ('BOTTOMPADDING', (0,0), (-1,-1), 5), ])) story.append(summary_table) story.append(Spacer(1, 10)) story.append(Paragraph( "Hair fall is not random — it is a biological signal. Identify the real cause, address it with the right tool, " "stay consistent, and results follow. If the cause is genetic DHT sensitivity, only proven medical treatment " "will stop and reverse it. Everything else supports the journey — it cannot replace the foundation.", body_style)) story.append(Spacer(1, 12)) story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#cccccc'), spaceAfter=6)) story.append(Paragraph( "<b>Disclaimer:</b> This document is for educational purposes only. Muhammad Ali (@gains_by_ali) is not a " "licensed doctor or medical professional. Nothing here constitutes medical advice, diagnosis, or treatment. " "Always consult a qualified healthcare professional before starting any supplement, medication, or treatment. " "Results vary by individual. Stop any product immediately if adverse effects occur.", note_style)) story.append(Spacer(1, 6)) story.append(Paragraph("— Muhammad Ali | @gains_by_ali | Fitness &amp; Grooming Coach", subtitle_style)) doc.build(story) print("Done!") EOF

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/hair-fall-guide/Hair_Fall_Guide_Condensed.pdf') print(f'Total pages: {len(r.pages)}') "

Exactly 5 pages. Here's your condensed guide:

Hair Fall Guide Condensed

PDF Document · PDF

Here's what was condensed from the original 12 pages into 5:
Page 1 - Title, table of contents, Section 1 (Scalp Cleansing with wash-frequency table), Section 2 (External Damage Factors table)
Page 2 - Section 3A (DHT/Androgenetic Alopecia with signs table), Section 3B (Nutritional Deficiencies - Vitamin D, B12, Iron, Zinc, Protein in one unified table)
Page 3 - Section 4 (Telogen Effluvium table), Section 5 (Thyroid & Hormonal Issues), Section 6 (Oils vs. Reality - green/red comparison table)
Page 4 - Section 7 (Minoxidil + Finasteride - drug comparison, administration types, treatment timeline, and personal case)
Page 5 - Section 8 (Daily Habits table), Final Summary (green/red framework table), and Disclaimer
All promotional/coaching content was removed and all core science and protocols were preserved in clean, dense table format.
This is a shared conversation. Sign in to Orris to start your own chat.