Make an exam oriented notes on chapter 2 in easy and understandable way using table format
cd /home/daytona/workspace/attachments/8a081cf0-f9e4-4e74-9428-b85f9f7890fc && python3 -c " import pdfplumber with pdfplumber.open('Shanbhag Pharmacology.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') # Read first few pages to find chapter 2 for i in range(0, 30): text = pdf.pages[i].extract_text() if text: print(f'--- PAGE {i+1} ---') print(text[:500]) print() "
cd /home/daytona/workspace/attachments/8a081cf0-f9e4-4e74-9428-b85f9f7890fc && python3 -c " import pdfplumber with pdfplumber.open('Shanbhag Pharmacology.pdf') as pdf: # Chapter 2 starts at page 46 in book = roughly PDF page 57-58 area # Let's find exact start by searching for i in range(50, 120): text = pdf.pages[i].extract_text() if text and ('Autonomic Pharmacology' in text or 'AUTONOMIC' in text or 'autonomic' in text.lower()): print(f'PAGE {i+1}: {text[:200]}') print('---') "
cd /home/daytona/workspace/attachments/8a081cf0-f9e4-4e74-9428-b85f9f7890fc && python3 -c " import pdfplumber chapter2_text = '' with pdfplumber.open('Shanbhag Pharmacology.pdf') as pdf: for i in range(64, 117): # pages 65-117 (0-indexed: 64-116) text = pdf.pages[i].extract_text() if text: chapter2_text += f'\n\n=== PDF PAGE {i+1} ===\n' + text print(chapter2_text) " > /home/daytona/workspace/chapter2_raw.txt 2>&1 echo "Done, file size: $(wc -c < /home/daytona/workspace/chapter2_raw.txt) bytes"
mkdir -p /home/daytona/workspace/ch2-notes && cat > /home/daytona/workspace/ch2-notes/create_notes.js << 'JSEOF' const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType, VerticalAlign, PageBreak } = require('docx'); const fs = require('fs'); // Color palette const HEADER_BG = "1F4E79"; // dark blue const SUB_BG = "2E75B6"; // medium blue const ALT_ROW = "D6E4F0"; // light blue const WHITE = "FFFFFF"; const YELLOW_BG = "FFF2CC"; const GREEN_BG = "E2EFDA"; const RED_BG = "FCE4D6"; function hdr(text, level = HeadingLevel.HEADING_1) { return new Paragraph({ heading: level, children: [new TextRun({ text, bold: true, color: HEADER_BG, size: level === HeadingLevel.HEADING_1 ? 32 : 26 })] }); } function subHdr(text) { return new Paragraph({ heading: HeadingLevel.HEADING_2, children: [new TextRun({ text, bold: true, color: "2E75B6", size: 24 })] }); } function para(text) { return new Paragraph({ children: [new TextRun({ text, size: 20 })] }); } function bullet(text, level = 0) { return new Paragraph({ bullet: { level }, children: [new TextRun({ text, size: 20 })] }); } function note(text, color = YELLOW_BG) { return new Paragraph({ shading: { type: ShadingType.SOLID, color, fill: color }, children: [new TextRun({ text: "📝 " + text, bold: true, size: 20 })] }); } function makeTable(headers, rows, headerBg = HEADER_BG) { const headerRow = new TableRow({ children: headers.map(h => new TableCell({ shading: { type: ShadingType.SOLID, color: headerBg, fill: headerBg }, verticalAlign: VerticalAlign.CENTER, children: [new Paragraph({ children: [new TextRun({ text: h, bold: true, color: WHITE, size: 19 })] })] })) }); const dataRows = rows.map((row, rIdx) => new TableRow({ children: row.map((cell, cIdx) => new TableCell({ shading: rIdx % 2 === 0 ? undefined : { type: ShadingType.SOLID, color: ALT_ROW, fill: ALT_ROW }, children: [new Paragraph({ children: [new TextRun({ text: cell, size: 18 })] })] })) })); return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows: [headerRow, ...dataRows] }); } const doc = new Document({ sections: [{ children: [ // TITLE new Paragraph({ alignment: AlignmentType.CENTER, children: [ new TextRun({ text: "CHAPTER 2 — AUTONOMIC PHARMACOLOGY", bold: true, size: 40, color: HEADER_BG }), ] }), new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: "Exam-Oriented Notes | Shanbhag Pharmacology", size: 22, italics: true, color: "555555" })] }), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 1: ANS INTRO //========================================= hdr("1. INTRODUCTION TO AUTONOMIC NERVOUS SYSTEM"), para("The ANS controls involuntary functions (heart, smooth muscle, glands). It has two divisions: Sympathetic (thoracolumbar, T1–L3) and Parasympathetic (craniosacral, CN III/VII/IX/X + S2–S4)."), new Paragraph({ children: [new TextRun({ text: "" })] }), makeTable( ["Feature", "Sympathetic", "Parasympathetic"], [ ["Origin", "Thoracolumbar (T1–L3)", "Craniosacral (CN III,VII,IX,X; S2–S4)"], ["Preganglionic fibre", "Short", "Long"], ["Postganglionic fibre", "Long", "Short"], ["Neurotransmitter (pre)", "ACh", "ACh"], ["Neurotransmitter (post)", "Noradrenaline (NA)", "ACh"], ["Effect", "Fight, Fright, Flight", "Rest and Digest"], ["Receptor (post)", "α, β adrenergic", "Muscarinic"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), makeTable( ["Feature", "ANS", "Somatic NS"], [ ["Control", "Involuntary", "Voluntary"], ["Neuron chain", "2 neurons (pre + post ganglionic)", "1 motor neuron"], ["Effectors", "Heart, smooth muscle, glands", "Skeletal muscle"], ["Junction", "Neuroeffector junction", "Neuromuscular junction (NMJ)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 2: CHOLINERGIC SYSTEM //========================================= hdr("2. CHOLINERGIC SYSTEM"), subHdr("2A. Cholinergic Transmission Sites"), para("ACh is released at: (1) All preganglionic fibres (sympathetic & parasympathetic), (2) Postganglionic parasympathetic fibres, (3) Postganglionic sympathetic fibres to sweat glands, (4) NMJ (skeletal muscle), (5) Adrenal medulla."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("2B. Cholinergic Receptors"), makeTable( ["Receptor", "Location", "Effect of Stimulation", "2nd Messenger"], [ ["M1 (muscarinic)", "Gastric parietal cells, CNS, autonomic ganglia", "↑ Gastric acid, CNS effects", "↑ IP3/DAG"], ["M2 (muscarinic)", "Heart (SA node, AV node)", "↓ HR, ↓ conduction (negative chrono/dromo/inotropic)", "↓ cAMP"], ["M3 (muscarinic)", "Smooth muscle, glands, vascular endothelium", "Contraction, secretion, vasodilation via NO", "↑ IP3/DAG"], ["Nm (nicotinic)", "NMJ (skeletal muscle)", "Muscle contraction", "Ion channel (Na+)"], ["Nn (nicotinic)", "Autonomic ganglia, adrenal medulla", "Ganglionic stimulation, adrenaline release", "Ion channel (Na+)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("2C. Muscarinic Actions of ACh (Mnemonic: DUMB BELSS)"), makeTable( ["System", "Effect (ACh/Muscarinic)"], [ ["Heart (M2)", "↓ HR (bradycardia), ↓ force, ↓ AV conduction"], ["Blood Vessels (M3)", "Vasodilation via NO release from endothelium → ↓ BP"], ["GIT (M3)", "↑ Tone + peristalsis, relax sphincters → diarrhoea, defecation"], ["Urinary Bladder (M3)", "↑ Detrusor tone, relax trigone/sphincter → micturition"], ["Bronchi (M3)", "Bronchoconstriction + ↑ bronchial secretions"], ["Eye (M3)", "Miosis (sphincter pupillae) + Accommodation (ciliary muscle contracts) → ↓ IOP"], ["Exocrine glands", "↑ Saliva, sweat, lacrimal, gastric, bronchial secretions"], ["CNS", "Stimulation (at low doses)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Exam Pearl: ACh does NOT produce effects on topical application to eye due to poor penetration."), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 3: CHOLINERGIC AGENTS //========================================= hdr("3. CHOLINERGIC AGONISTS (Parasympathomimetics)"), subHdr("3A. Choline Esters"), makeTable( ["Drug", "Hydrolysis by ChE", "Muscarinic Action", "Nicotinic Action", "Blocked by Atropine?", "Main Use"], [ ["Acetylcholine (ACh)", "True + Pseudo ChE", "✓", "✓", "Fully (muscarinic)", "Not used therapeutically (too short)"], ["Carbachol", "Resistant (both)", "✓", "✓", "Not completely", "Glaucoma"], ["Bethanechol", "Resistant (both)", "✓", "✗", "Completely", "Postoperative urinary retention, paralytic ileus"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("3B. Alkaloids"), makeTable( ["Drug", "Source/Type", "Key Features", "Uses"], [ ["Pilocarpine", "Alkaloid – tertiary amine", "Penetrates eye; produces miosis + ↓ IOP; short-acting (4–8 hr)", "Glaucoma (1st choice), Xerostomia (Sjögren's syndrome)"], ["Muscarine", "Alkaloid (mushrooms)", "Purely muscarinic; no therapeutic use", "Toxicological importance (mushroom poisoning)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 4: ANTICHOLINESTERASES //========================================= hdr("4. ANTICHOLINESTERASES (Cholinesterase Inhibitors)"), para("They inhibit acetylcholinesterase (AChE) → ACh accumulates → produces both muscarinic + nicotinic effects."), new Paragraph({ children: [new TextRun({ text: "" })] }), makeTable( ["Class", "Drugs", "Bond with AChE", "Duration"], [ ["Short-acting", "Edrophonium", "Reversible (electrostatic)", "8–10 min"], ["Medium-acting (Carbamates)", "Physostigmine, Neostigmine, Pyridostigmine, Rivastigmine", "Reversible (carbamylation)", "Hours"], ["Irreversible (Organophosphates)", "Parathion, Malathion, Dyflos, Echothiophate, Sarin", "Covalent (phosphorylation)", "Permanent (days-weeks)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("4A. Physostigmine vs Neostigmine"), makeTable( ["Feature", "Physostigmine", "Neostigmine"], [ ["Source", "Natural alkaloid (Physostigma venenosum)", "Synthetic"], ["Chemical nature", "Tertiary amine", "Quaternary ammonium compound"], ["CNS penetration", "Yes (crosses BBB)", "No"], ["Eye penetration", "Good (topically effective)", "Poor (topically NOT effective)"], ["Direct NMJ action", "No", "Yes (direct NM stimulation + indirect)"], ["Uses", "Atropine poisoning, Glaucoma", "Myasthenia gravis, postop urinary retention/ileus, curare reversal"], ["Preferred in MG", "No (CNS side effects)", "Yes (also pyridostigmine preferred for long-term)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("4B. Uses of Anticholinesterases"), makeTable( ["Indication", "Drug of Choice", "Reason"], [ ["Myasthenia gravis (diagnosis)", "Edrophonium (2 mg IV)", "Rapid onset, short action"], ["Myasthenia gravis (treatment)", "Pyridostigmine (preferred) / Neostigmine", "Longer action; better tolerated"], ["Atropine/belladonna poisoning", "Physostigmine IV", "Crosses BBB – reverses CNS + peripheral effects"], ["Glaucoma", "Physostigmine / Echothiophate", "Reduces IOP by miosis"], ["Curare poisoning / reversal", "Neostigmine + Atropine", "Neostigmine reverses block; atropine covers muscarinic SEs"], ["Postop urinary retention/paralytic ileus", "Neostigmine", "↑ smooth muscle tone, relaxes sphincters"], ["Alzheimer's disease", "Donepezil, Rivastigmine, Galantamine", "Cerebroselective; ↑ cerebral ACh"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("4C. Myasthenic Crisis vs Cholinergic Crisis"), makeTable( ["Feature", "Myasthenic Crisis", "Cholinergic Crisis"], [ ["Cause", "Exacerbation of MG (under-treatment)", "Excess anticholinesterases"], ["Edrophonium test", "Improvement in weakness", "Worsening of weakness"], ["Muscarinic signs", "Absent", "Present (salivation, sweating, miosis)"], ["Treatment", "↑ Anticholinesterase dose", "Stop anticholinesterases, atropine"], ["Caution", "Keep ventilator ready before edrophonium test", "—"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Drugs contraindicated in Myasthenia Gravis: Aminoglycosides, d-TC, β-blockers, phenytoin, ether."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("4D. Organophosphate (OP) Poisoning"), makeTable( ["Feature", "Details"], [ ["Examples", "Parathion, Malathion, Dyflos, Sarin (nerve gas)"], ["Mechanism", "Irreversible covalent inhibition of AChE → ACh accumulation"], ["Muscarinic symptoms", "DUMBELS: Diarrhoea, Urination, Miosis, Bradycardia, Emesis, Lacrimation, Salivation + bronchospasm, sweating, hypotension"], ["Nicotinic symptoms", "Twitchings, fasciculations, muscle weakness → paralysis"], ["CNS symptoms", "Headache, restlessness, confusion, convulsions, coma"], ["Treatment – Atropine", "Large doses IV (2–4 mg, repeat every 5–10 min) – for MUSCARINIC effects"], ["Treatment – Pralidoxime (PAM)", "Reactivates AChE if given EARLY (before 'ageing'). For NICOTINIC effects"], ["Note", "Pralidoxime is ineffective once 'ageing' of AChE occurs (irreversible phosphorylation matures)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 5: ANTICHOLINERGICS / ATROPINE //========================================= hdr("5. ANTICHOLINERGICS (Muscarinic Antagonists)"), subHdr("5A. Classification"), makeTable( ["Class", "Examples"], [ ["Natural alkaloids (tertiary amines)", "Atropine, Scopolamine (hyoscine), Hyoscyamine"], ["Semisynthetic (eye)", "Homatropine, Ipratropium, Tiotropium"], ["Synthetic – antispasmodics", "Dicyclomine, Valethamate, Oxybutynin, Tolterodine, Flavoxate, Darifenacin, Solifenacin"], ["Synthetic – cycloplegics (eye)", "Cyclopentolate, Tropicamide"], ["Synthetic – antiparkinsonians", "Benzhexol (trihexyphenidyl), Benztropine, Procyclidine"], ["Synthetic – antiulcer", "Pirenzepine (M1 selective)"], ["Ganglion blockers", "Trimethaphan, Hexamethonium"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5B. Actions of Atropine"), makeTable( ["System", "Effect", "Receptor Blocked"], [ ["Heart", "↑ HR (tachycardia), ↑ AV conduction (reverses vagal bradycardia)", "M2"], ["Blood vessels", "Vasodilation at high doses (NOT via muscarinic block)", "—"], ["GIT", "↓ Tone + motility, ↑ sphincter tone → constipation, dry mouth", "M3"], ["Urinary bladder", "↓ Detrusor tone → urinary retention", "M3"], ["Bronchi", "Bronchodilation + ↓ secretions", "M3"], ["Eye", "Mydriasis (dilated pupil) + Cycloplegia (paralysis of accommodation) + ↑ IOP", "M3"], ["Exocrine glands", "↓ All secretions (dry mouth, ↓ sweating)", "M3"], ["CNS", "Mild stimulation (low doses), sedation/hallucination (high doses)", "Central M"], ["Temperature", "↑ Body temperature (due to ↓ sweating)", "—"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Sensitivity order to atropine: Salivary/sweat/lacrimal glands → Eye (mydriasis) → Bronchi → GIT → Bladder → Heart → Gastric acid (requires very high dose)"), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5C. Atropine vs Phenylephrine (Eye Effects)"), makeTable( ["Feature", "Atropine", "Phenylephrine/Ephedrine"], [ ["Mechanism", "Anticholinergic (blocks M3)", "Sympathomimetic (α1 agonist)"], ["Mydriasis type", "Passive (relaxes sphincter pupillae)", "Active (contracts dilator pupillae)"], ["Cycloplegia", "Yes (lens fixed for distance, blurred near vision)", "No"], ["Light reflex", "Absent", "Present"], ["IOP", "↑ IOP (may precipitate glaucoma)", "↓ IOP (↓ aqueous humour formation)"], ["Contraindication", "Narrow-angle glaucoma", "—"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5D. Therapeutic Uses of Atropine"), makeTable( ["Indication", "Dose/Route", "Notes"], [ ["Organophosphate poisoning", "2–4 mg IV, repeat every 5–10 min", "Blocks muscarinic effects; titrate to dry secretions"], ["Sinus bradycardia / heart block", "0.5–1 mg IV", "Reverses excess vagal tone"], ["Preanesthetic medication", "0.6 mg SC/IM", "↓ secretions, prevent vagal effects"], ["Peptic ulcer", "Pirenzepine preferred (M1 selective)", "Atropine has too many side effects"], ["Irritable bowel syndrome/colic", "Dicyclomine/Valethamate", "Antispasmodic effect"], ["Ophthalmology (refraction tests)", "Atropine or Cyclopentolate/Tropicamide", "Cycloplegia for refraction in children"], ["Mushroom poisoning (Inocybe)", "Atropine", "Drug of choice"], ["Curare poisoning (with neostigmine)", "Atropine given first", "Prevents muscarinic side effects of neostigmine"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5E. Scopolamine (Hyoscine)"), makeTable( ["Feature", "Details"], [ ["Type", "Tertiary amine (crosses BBB)"], ["Unique actions vs atropine", "Sedation, amnesia, antiemesis (unlike atropine which mildly stimulates)"], ["Uses", "Motion sickness (transdermal patch behind ear), preanesthetic sedation"], ["Antiemetic mechanism", "Blocks M1/H1 receptors at vestibular apparatus and cerebellum"], ["Eye", "Longer mydriasis/cycloplegia than atropine"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5F. Bladder-Selective Antimuscarinics"), makeTable( ["Drug", "Selectivity", "Use"], [ ["Oxybutynin", "M1 + M3 (bladder + salivary gland)", "Overactive bladder, nocturnal enuresis, spasm post-urology surgery"], ["Tolterodine", "M3 (bladder > salivary gland)", "Less dry mouth; overactive bladder (frequency + urgency)"], ["Darifenacin / Solifenacin", "M3 (selective for bladder)", "Overactive bladder; least dry mouth"], ["Flavoxate", "Similar to oxybutynin", "Urgency/frequency due to cystitis, prostatitis, urethritis"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("5G. Ipratropium / Tiotropium"), makeTable( ["Drug", "Route", "Key Feature", "Use"], [ ["Ipratropium", "Inhaled", "Quaternary amine; minimal systemic effects; short-acting (4–6 hr)", "COPD, bronchial asthma"], ["Tiotropium", "Inhaled", "Long-acting (24 hr); once daily", "COPD (maintenance)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 6: GANGLION BLOCKERS //========================================= hdr("6. GANGLION BLOCKERS"), makeTable( ["Drug", "Type", "Use"], [ ["Trimethaphan", "Short-acting (IV infusion)", "Controlled hypotension during neurosurgery"], ["Hexamethonium", "Historical; no longer used", "Hypertension (older use)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), para("Effects of ganglion block: Postural hypotension (sympathetic block) + atropine-like effects (parasympathetic block: tachycardia, mydriasis, dry mouth, constipation, urinary retention)."), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Nicotine: Initial stimulation → prolonged block at autonomic ganglia. Tobacco is a risk factor for oral, lung, and heart disease."), makeTable( ["Drug", "Mechanism", "Use for Smoking Cessation"], [ ["Nicotine gum/patch", "Nicotine replacement therapy", "Reduces withdrawal symptoms"], ["Bupropion", "Inhibits NA + DA reuptake", "Reduces craving"], ["Varenicline", "Partial agonist at nicotinic receptors", "Reduces craving + withdrawal"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 7: SKELETAL MUSCLE RELAXANTS //========================================= hdr("7. SKELETAL MUSCLE RELAXANTS"), subHdr("7A. Classification"), makeTable( ["Class", "Examples"], [ ["Centrally acting", "Diazepam, Methocarbamol, Chlorzoxazone, Tizanidine, Baclofen, Carisoprodol, Thiocolchicoside"], ["Peripherally acting – Nondepolarizing", "d-TC (long), Pancuronium (long), Vecuronium (intermediate), Rocuronium (intermediate), Atracurium (intermediate), Cisatracurium (intermediate), Mivacurium (short)"], ["Peripherally acting – Depolarizing", "Succinylcholine (SCh), Decamethonium"], ["Directly acting", "Dantrolene"], ["Other", "Botulinum toxin A"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("7B. d-TC vs Succinylcholine (Exam Favourite Comparison)"), makeTable( ["Feature", "d-Tubocurarine (d-TC)", "Succinylcholine (SCh)"], [ ["Source", "Natural alkaloid", "Synthetic"], ["Type of block", "Nondepolarizing (competitive)", "Depolarizing (Phase I, then Phase II)"], ["Duration", "Long (80 min)", "Short (3–8 min) – hydrolyzed by pseudocholinesterase"], ["Onset of paralysis", "Flaccid paralysis (no fasciculations)", "First fasciculations, then flaccid paralysis"], ["Histamine release", "+++ (significant)", "++ (moderate)"], ["Reversal", "Neostigmine + Atropine", "Phase II block partially reversed by neostigmine"], ["Ganglionic block", "Yes (hypotension)", "No"], ["Preferred use", "Adjuvant to general anaesthesia (long procedures)", "Short procedures: endotracheal intubation, endoscopy, orthopaedic manipulations"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("SCh adverse effects: Bradycardia, ↑K+ (dangerous in burns/trauma), malignant hyperthermia, prolonged apnoea (pseudocholinesterase deficiency), raised IOP, raised intragastric pressure."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("7C. Individual Nondepolarizing Blockers"), makeTable( ["Drug", "Duration", "Special Features"], [ ["d-TC (curare)", "Long", "Histamine release +++; ganglionic block → hypotension"], ["Pancuronium", "Long", "Vagolytic → tachycardia; no histamine release; renal excretion"], ["Doxacurium / Pipecuronium", "Long", "Minimal CVS effects"], ["Vecuronium", "Intermediate", "Minimal histamine; minimal CVS effects; hepatic metabolism"], ["Rocuronium", "Intermediate", "Rapid onset; minimal histamine; used when SCh contraindicated"], ["Atracurium", "Intermediate", "Hofmann degradation (safe in hepatic/renal dysfunction); causes histamine release"], ["Cisatracurium", "Intermediate", "Hofmann degradation; MORE potent; NO histamine; safe in elderly/organ failure"], ["Mivacurium", "Short (15–20 min)", "Hydrolyzed by pseudocholinesterase; histamine release; no reversal needed"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("7D. Drug Interactions of Muscle Relaxants"), makeTable( ["Interaction", "Result"], [ ["Aminoglycosides + nondepolarizing blockers", "Potentiation → require dose reduction"], ["Tetracyclines / Clindamycin + nondepolarizing", "Potentiation of block"], ["Thiazides/loop diuretics + nondepolarizing", "Hypokalaemia potentiates block"], ["SCh + Thiopentone (in same syringe)", "Precipitation (pharmaceutical incompatibility)"], ["General anaesthetics + muscle relaxants", "Potentiation of neuromuscular block"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("7E. Dantrolene and Botulinum Toxin"), makeTable( ["Drug", "MOA", "Uses"], [ ["Dantrolene", "Inhibits Ca2+ release from SR of skeletal muscle → directly reduces contraction", "Malignant hyperthermia (drug of choice), Neuroleptic malignant syndrome, Muscle spasticity"], ["Botulinum toxin A", "Blocks release of ACh from cholinergic nerve terminals (vesicle fusion inhibition)", "Focal dystonia, blepharospasm, strabismus, cosmetic (wrinkles), achalasia, cervical dystonia"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 8: ADRENERGIC AGONISTS //========================================= hdr("8. ADRENERGIC SYSTEM & AGONISTS"), subHdr("8A. Adrenergic Receptors — Distribution & Effects"), makeTable( ["Receptor", "Location", "Effect of Stimulation", "2nd Messenger"], [ ["α1", "Blood vessels (skin, mucosa, renal), GI sphincter, urinary sphincter, radial muscle (iris)", "Vasoconstriction, ↑ sphincter tone, mydriasis", "↑ IP3/DAG"], ["α2 (presynaptic)", "Adrenergic nerve terminals", "Negative feedback → ↓ NA release", "↓ cAMP"], ["α2 (postsynaptic)", "Vascular smooth muscle", "Vasoconstriction, venoconstriction", "↓ cAMP"], ["β1", "Heart, juxtaglomerular cells (kidney)", "↑ HR, ↑ contractility, ↑ conduction, ↑ renin release", "↑ cAMP"], ["β2", "Bronchi, uterus, blood vessels (skeletal), liver", "Bronchodilation, uterine relaxation, vasodilation, glycogenolysis", "↑ cAMP"], ["β3", "Adipose tissue", "Lipolysis", "↑ cAMP"], ["D1", "Renal, mesenteric, coronary vessels", "Vasodilation", "↑ cAMP"], ["D2", "Presynaptic, pituitary, gut", "↓ NA release, inhibit prolactin", "↓ cAMP"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8B. Synthesis & Fate of Catecholamines"), makeTable( ["Step", "Detail"], [ ["Synthesis pathway", "Tyrosine → DOPA → Dopamine → Noradrenaline → Adrenaline"], ["Key enzyme: Synthesis", "Tyrosine hydroxylase (rate-limiting), DOPA decarboxylase, DBH (dopamine β-hydroxylase), PNMT"], ["Termination of action", "Neuronal reuptake (MOST IMPORTANT) → stored or degraded by MAO"], ["Enzymatic degradation", "MAO (mitochondrial) + COMT (liver/gut)"], ["Main metabolite", "Vanillylmandelic acid (VMA) — normal: 4–8 mg/24 hr urine"], ["↑ VMA significance", "Pheochromocytoma (tumour of adrenal medulla)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8C. Classification of Adrenergic Agonists"), makeTable( ["Class", "Drugs", "Receptors"], [ ["Direct-acting nonselective", "Adrenaline (epinephrine)", "α1, α2, β1, β2, β3"], ["Direct-acting nonselective", "Noradrenaline (norepinephrine)", "α1, α2, β1 (weak β2)"], ["Direct-acting α1", "Phenylephrine, Methoxamine", "α1"], ["Direct α1+α2 / nasal decongestants", "Naphazoline, Oxymetazoline, Xylometazoline", "α1 + α2"], ["Direct α2 (antihypertensives)", "Clonidine, Methyldopa (α-methylnoradrenaline)", "α2 (central)"], ["Direct α2 (glaucoma)", "Apraclonidine, Brimonidine", "α2"], ["Direct β1 (cardiac)", "Dobutamine", "β1 (predominant), β2, α1"], ["Direct β2 (bronchial asthma)", "Salbutamol, Terbutaline, Salmeterol, Formoterol", "β2 selective"], ["Direct β2 (uterine relaxant)", "Ritodrine, Isoxsuprine", "β2"], ["Direct D1 (vasodilator)", "Fenoldopam", "D1"], ["Indirect (release NA)", "Amphetamine, Methylphenidate", "Releases NA/DA/5-HT"], ["Mixed (direct + indirect)", "Ephedrine, Dopamine, Mephentermine", "Multiple"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8D. Adrenaline (Epinephrine) — Key Points"), makeTable( ["Feature", "Details"], [ ["Receptors", "α1, α2, β1, β2, β3 — all adrenergic receptors"], ["CVS: Heart (β1)", "↑ HR (chronotropic), ↑ contractility (inotropic), ↑ conduction (dromotropic), ↑ automaticity → arrhythmias"], ["CVS: Blood vessels", "Skin/mucosa/renal → constrict (α1); skeletal/coronary → dilate (β2)"], ["BP effect (moderate IV dose)", "Biphasic: initial ↑ BP (α + β1) then ↓ BP (β2 vasodilatation); adrenaline reversal by α-blocker"], ["Bronchi (β2)", "Bronchodilatation + inhibits mediator release from mast cells"], ["Eye", "Reduces IOP (↓ aqueous formation); mydriasis (α1)"], ["Metabolic", "↑ Glycogenolysis, ↑ lipolysis, ↑ FFA, ↑ blood glucose"], ["Adrenaline reversal", "After α-blocker pretreatment: only β2 effects seen → BP falls (pure vasodilation)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), makeTable( ["Use of Adrenaline", "Dose/Route", "Rationale"], [ ["Anaphylactic shock (drug of choice)", "0.5 mg IM (1:1000)", "α1 vasoconstriction, β2 bronchodilation, mast cell stabilization"], ["Cardiac arrest", "1 mg IV (1:10,000)", "β1 stimulation + vasoconstriction"], ["Local anaesthesia (adjuvant)", "1:100,000–1:200,000 with lignocaine", "Vasoconstriction → prolongs LA action, ↓ systemic absorption"], ["Acute bronchial asthma", "SC 0.3–0.5 mL (1:1000)", "β2 bronchodilation (rarely used – selective β2 preferred)"], ["Open-angle glaucoma", "Topical", "↓ Aqueous humour formation"], ["Haemostasis during surgery", "Topical", "Local vasoconstriction"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Adrenaline CONTRAINDICATED in hypertension, hyperthyroidism, cardiac arrhythmias, and with halothane anaesthesia (arrhythmia risk)."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8E. Noradrenaline vs Adrenaline vs Dopamine vs Dobutamine"), makeTable( ["Drug", "Receptors", "BP effect", "HR", "Key Use"], [ ["Noradrenaline", "α1+α2 >>> β1 (weak β2)", "↑↑ (vasoconstriction dominant)", "↓ (reflex bradycardia)", "Septic shock with vasoplegia"], ["Adrenaline", "α1+α2+β1+β2+β3", "Biphasic (↑ then ↓)", "↑", "Anaphylaxis, cardiac arrest"], ["Dopamine (low dose)", "D1 >> β1", "Mild ↑; renal/mesenteric vasodilation", "Slight ↑", "Cardiogenic shock with oliguria, CCF"], ["Dopamine (high dose)", "α1 > β1 > D1", "↑↑", "↑", "Refractory hypotension"], ["Dobutamine", "β1 >> β2 > α1", "Mild; slight ↑", "Slight ↑", "Acute heart failure (no oliguria); inotropic support"], ["Isoprenaline", "β1 + β2 (no α)", "↓ (vasodilation)", "↑↑", "Heart block, Bradycardia (now largely replaced)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8F. Selective β2 Agonists"), makeTable( ["Drug", "Onset", "Duration", "Route", "Uses"], [ ["Salbutamol (Albuterol)", "Rapid", "4–6 hr", "Inhaled, oral, IV", "Acute asthma, premature labour, hyperkalaemia"], ["Terbutaline", "Rapid", "4–6 hr", "Inhaled, SC, oral", "Asthma, premature labour"], ["Salmeterol", "Slow (30 min)", "12 hr (long-acting)", "Inhaled", "Prophylaxis of asthma/COPD (not acute attack)"], ["Formoterol", "Rapid", "12 hr (long-acting)", "Inhaled", "Both acute + prophylaxis (SMART therapy)"], ["Levalbuterol", "Rapid", "6–8 hr", "Inhaled", "Asthma (R-isomer of salbutamol; fewer SEs)"], ] ), note("β2 adverse effects: Tremor (β2 in skeletal muscle), tachycardia (cardiac β1 at high doses), hypokalaemia (β2 → K+ uptake into cells)."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("8G. Clonidine (α2 Agonist)"), makeTable( ["Feature", "Details"], [ ["Mechanism", "Stimulates central α2 receptors (nucleus tractus solitarius) → ↓ sympathetic outflow → ↓ BP"], ["Also stimulates", "Peripheral presynaptic α2 → ↓ NA release"], ["Uses", "Hypertension, opioid withdrawal, menopausal flushing, ADHD, migraine prophylaxis"], ["Adverse effects", "Dry mouth, sedation, rebound hypertension on abrupt withdrawal"], ["Withdrawal management", "Gradual dose tapering; IV phentolamine for hypertensive crisis"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // SECTION 9: ADRENERGIC BLOCKERS //========================================= hdr("9. ADRENERGIC BLOCKERS"), subHdr("9A. α-Blockers — Classification"), makeTable( ["Class", "Drugs", "Selectivity"], [ ["Nonselective irreversible", "Phenoxybenzamine", "α1 + α2 (covalent bond)"], ["Nonselective reversible", "Phentolamine, Tolazoline", "α1 + α2"], ["Selective α1 reversible", "Prazosin, Terazosin, Doxazosin, Alfuzosin, Tamsulosin, Silodosin", "α1"], ["Selective α2", "Yohimbine", "α2 (aphrodisiac)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), makeTable( ["Use of α-Blockers", "Drug of Choice", "Notes"], [ ["Pheochromocytoma (preoperative)", "Phenoxybenzamine (oral, long-term), Phentolamine (IV, intraoperative)", "Phenoxybenzamine given 1–2 weeks before surgery"], ["Hypertensive emergencies (pheochromocytoma)", "Phentolamine IV", "Rapid onset"], ["Essential hypertension", "Prazosin/Doxazosin/Terazosin", "Selective α1; less tachycardia; favourable lipid profile"], ["Benign prostatic hyperplasia (BPH) + hypertension", "Prazosin, Doxazosin, Terazosin, Alfuzosin", "α1 block → relaxes bladder neck/prostate → ↓ urinary resistance"], ["BPH in normotensive patients", "Tamsulosin (α1A selective)", "Least orthostatic hypotension"], ["Tissue necrosis (extravasation of vasopressors)", "Phentolamine (local infiltration)", "Counteracts α1 vasoconstriction"], ["Male sexual dysfunction", "Phentolamine + papaverine (local injection)", "Penile blood flow ↑"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), note("Postural hypotension = major side effect of α-blockers (especially first dose of prazosin — 'First-dose phenomenon')."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("9B. β-Blockers — Classification"), makeTable( ["Generation", "Drugs", "Selectivity", "Special Properties"], [ ["1st Generation (nonselective β)", "Propranolol, Timolol, Nadolol, Pindolol, Sotalol", "β1 + β2", "Propranolol: prototype; MSA; lipophilic"], ["2nd Generation (β1-selective)", "Atenolol, Bisoprolol, Esmolol, Metoprolol, Acebutolol", "β1 > β2", "Safer in asthma/COPD (relative selectivity)"], ["3rd Generation (vasodilatory)", "Labetalol, Carvedilol (nonselective)", "β1+β2+α1", "Used in hypertension, heart failure"], ["3rd Generation (β1-selective vasodilatory)", "Nebivolol, Betaxolol, Celiprolol", "β1 selective", "Nebivolol: releases NO (vasodilation)"], ] ), note("ISA (intrinsic sympathomimetic activity): Pindolol, Acebutolol, Labetalol — partial β-agonists. Less bradycardia at rest. MSA (membrane stabilizing): Propranolol, Pindolol, Acebutolol, Metoprolol, Labetalol."), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("9C. β-Blockers — Pharmacological Effects"), makeTable( ["System", "Effect of β-Blockade"], [ ["Heart", "↓ HR, ↓ contractility, ↓ AV conduction → ↓ cardiac output, ↓ O2 demand"], ["BP", "↓ BP (via ↓ cardiac output + ↓ renin release)"], ["Kidney", "↓ Renin release (β1 block of juxtaglomerular cells)"], ["Bronchi (β2)", "Bronchoconstriction → contraindicated in asthma"], ["Metabolic", "Inhibits glycogenolysis → masks hypoglycaemia (dangerous in diabetics); ↑ triglycerides, ↓ HDL"], ["Eye", "↓ IOP (↓ aqueous humour production)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("9D. Therapeutic Uses of β-Blockers"), makeTable( ["Indication", "Drug(s) Preferred", "Notes"], [ ["Hypertension", "Atenolol, Bisoprolol, Metoprolol", "First-line, especially in young patients"], ["Angina pectoris", "Propranolol, Atenolol, Metoprolol", "↓ HR → ↓ O2 demand"], ["Cardiac arrhythmias (SVT)", "Propranolol, Esmolol (IV, short-acting)", "Esmolol for acute SVT control"], ["Post-MI", "Metoprolol, Atenolol, Carvedilol", "↓ Mortality; anti-remodelling"], ["Chronic heart failure", "Carvedilol, Bisoprolol, Metoprolol", "Reduce mortality in stable CHF"], ["Glaucoma (topical)", "Timolol, Betaxolol", "↓ Aqueous humour production"], ["Migraine prophylaxis", "Propranolol, Metoprolol", "Mechanism not fully known"], ["Hyperthyroidism/thyroid storm", "Propranolol", "↓ Sympathetic symptoms; inhibits T4→T3 conversion"], ["Essential tremor", "Propranolol (oral)", "Peripheral β2 mechanism"], ["Hypertrophic obstructive cardiomyopathy", "Propranolol", "↓ Outflow obstruction"], ["Pheochromocytoma", "Propranolol (ONLY after α-blocker)", "Never alone — can precipitate hypertensive crisis"], ["Acute anxiety/performance anxiety", "Propranolol", "Blocks peripheral β effects (palpitation, tremor)"], ["Dissecting aortic aneurysm", "IV β-blocker", "↓ dP/dt (rate of pressure rise)"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("9E. β-Blocker Adverse Effects & Contraindications"), makeTable( ["Adverse Effect", "Mechanism"], [ ["Bronchospasm", "β2 block in airways"], ["Worsening of heart failure (acute)", "↓ Cardiac output"], ["Bradycardia / AV block", "β1 block in SA/AV node"], ["Masking hypoglycaemia", "β2 block → inhibits glycogenolysis; blocks tachycardia warning sign"], ["Peripheral vascular disease ↑", "β2 block → vasoconstriction"], ["Cold extremities", "↑ Peripheral vascular resistance"], ["Dyslipidaemia", "↑ TG, ↓ HDL (less with β1-selective)"], ["CNS: fatigue, nightmares, depression", "Lipophilic drugs (propranolol) cross BBB"], ["Rebound effect on sudden withdrawal", "Up-regulation of β-receptors → precipitate angina/MI"], ] ), makeTable( ["Contraindication", "Reason"], [ ["Bronchial asthma / COPD", "Bronchoconstriction"], ["Prinzmetal (variant) angina", "Unopposed α → vasospasm"], ["Hypoglycaemia-prone diabetics", "Masks hypoglycaemic warning"], ["Bradycardia / AV block", "Worsens conduction"], ["Peripheral vascular disease", "Worsens ischaemia"], ["Phaeochromocytoma (alone)", "Unopposed α → severe hypertension"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), subHdr("9F. Key Individual β-Blockers"), makeTable( ["Drug", "Key Feature"], [ ["Propranolol", "Prototype; nonselective; MSA; high lipid solubility (CNS entry); inhibits T4→T3"], ["Timolol", "Nonselective; used as eye drops for glaucoma"], ["Atenolol", "Selective β1; low lipid solubility (no CNS SEs); renal excretion; preferred in diabetics"], ["Esmolol", "IV only; t½ = 10 min (hydrolyzed by RBC esterases); acute SVT control"], ["Metoprolol", "Selective β1; MSA; used in CHF, post-MI"], ["Bisoprolol", "Most β1-selective; used in CHF (↓ mortality)"], ["Carvedilol", "Nonselective β + α1 block; antioxidant; CHF"], ["Labetalol", "β1+β2+α1 block; ISA at β2; IV for hypertensive emergencies; safe in pregnancy"], ["Nebivolol", "β1 selective + NO release → vasodilation; 3rd generation"], ["Sotalol", "Nonselective β; K+ channel block (Class III antiarrhythmic); QT prolongation risk"], ["Pindolol", "Nonselective β; ISA (partial agonist); least bradycardia"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), //========================================= // QUICK REFERENCE MNEMONICS //========================================= hdr("10. EXAM QUICK-REFERENCE & HIGH-YIELD PEARLS"), makeTable( ["Topic", "High-Yield Point"], [ ["Mnemonic for muscarinic effects", "DUMBELS: Diarrhoea, Urination, Miosis, Bradycardia, Emesis, Lacrimation, Salivation"], ["Mnemonic for OP poisoning (muscarinic)", "SLUDGE: Salivation, Lacrimation, Urination, Defecation, GI cramps, Emesis"], ["Edrophonium test", "Short-acting AChE inhibitor used for diagnosis of MG and crisis differentiation"], ["Pyridostigmine", "Preferred long-term drug in MG (longer action, better tolerated than neostigmine)"], ["Pilocarpine", "Drug of choice for acute angle-closure glaucoma emergencies"], ["Atropine eye drops", "Longest duration (7–14 days); Cyclopentolate = 24 hr; Tropicamide = 6 hr (fastest)"], ["Malignant hyperthermia", "Dantrolene is drug of choice (triggered by SCh + volatile anaesthetics)"], ["Cisatracurium", "Safe in ALL organ failures (Hofmann degradation) + no histamine"], ["Adrenaline reversal", "After phentolamine (α-block) → adrenaline causes only ↓ BP (β2 unopposed)"], ["Dopamine: dose-dependent effects", "Low: D1 (renal vasodilatation); Intermediate: β1 (↑ cardiac output); High: α1 (vasoconstriction)"], ["β-blocker + pheochromocytoma", "NEVER give β-blocker alone → unopposed α1 → hypertensive crisis"], ["Labetalol in pregnancy", "Safe β-blocker for hypertension in pregnancy"], ["VMA elevation", "Suggests pheochromocytoma (normal: 4–8 mg/24 hr urine)"], ["Salmeterol for acute attack", "NEVER use for acute asthma attack (slow onset 30 min); use salbutamol instead"], ["First-dose hypotension", "Classic with Prazosin (α1 blocker) — take at bedtime initially"], ] ), new Paragraph({ children: [new TextRun({ text: "" })] }), // FOOTER new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: "— Prepared from Shanbhag Pharmacology, 4th Edition, Chapter 2 —", size: 18, italics: true, color: "888888" })] }), ] }] }); Packer.toBuffer(doc).then(buffer => { fs.writeFileSync('/home/daytona/workspace/ch2-notes/Chapter2_Autonomic_Pharmacology_Notes.docx', buffer); console.log('Done!'); }).catch(e => console.error(e)); JSEOF cd /home/daytona/workspace/ch2-notes && node create_notes.js
Chapter2 Autonomic Pharmacology Notes
Word Document · DOCX
| Section | Content |
|---|---|
| 1. ANS Introduction | Sympathetic vs Parasympathetic; ANS vs Somatic NS comparison table |
| 2. Cholinergic System | Receptor types (M1/M2/M3/Nm/Nn) with locations, effects, 2nd messengers; Muscarinic actions of ACh |
| 3. Cholinergic Agonists | Choline esters (ACh, Carbachol, Bethanechol); Pilocarpine vs Muscarine |
| 4. Anticholinesterases | Classification table; Physostigmine vs Neostigmine (exam favourite); Uses by indication; Myasthenic vs Cholinergic crisis; OP poisoning (SLUDGE, treatment with Atropine + Pralidoxime) |
| 5. Anticholinergics | Atropine actions, uses, sensitivity order; Atropine vs Phenylephrine on eye; Scopolamine; bladder-selective drugs; Ipratropium/Tiotropium |
| 6. Ganglion Blockers | Trimethaphan; Smoking cessation drugs (Varenicline, Bupropion) |
| 7. Skeletal Muscle Relaxants | d-TC vs Succinylcholine (detailed comparison); individual NDMBs; drug interactions; Dantrolene; Botulinum toxin |
| 8. Adrenergic Agonists | Receptor distribution/effects; catecholamine synthesis/fate; VMA; Adrenaline (all actions + uses); NA vs Adrenaline vs Dopamine vs Dobutamine; selective β2 agonists; Clonidine |
| 9. Adrenergic Blockers | α-blocker classification + uses; β-blocker classification (1st/2nd/3rd gen); pharmacological effects; therapeutic uses; adverse effects + contraindications; key individual drug profiles |
| 10. High-Yield Pearls | 15 exam-critical points including mnemonics, drug-of-choice scenarios, and common traps |
Make it into compressed pdf file
cd /home/daytona/workspace/ch2-notes && python3 /home/daytona/skills/pdf/scripts/office/soffice.py --headless --convert-to pdf Chapter2_Autonomic_Pharmacology_Notes.docx 2>&1 && ls -lh *.pdf
ls /home/daytona/skills/
ls /home/daytona/skills/pdf/ && ls /home/daytona/skills/docx/
ls /home/daytona/skills/docx/scripts/ && ls /home/daytona/skills/pdf/scripts/
ls /home/daytona/skills/docx/scripts/office/
cd /home/daytona/workspace/ch2-notes && python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf Chapter2_Autonomic_Pharmacology_Notes.docx 2>&1
cd /tmp && python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf /home/daytona/workspace/ch2-notes/Chapter2_Autonomic_Pharmacology_Notes.docx 2>&1 && ls -lh /tmp/*.pdf
python3 -c " from pypdf import PdfReader, PdfWriter import os reader = PdfReader('/tmp/Chapter2_Autonomic_Pharmacology_Notes.pdf') writer = PdfWriter() for page in reader.pages: page.compress_content_streams() writer.add_page(page) writer.compress_identical_objects(remove_identicals=True, remove_orphans=True) output_path = '/home/daytona/workspace/ch2-notes/Chapter2_Autonomic_Pharmacology_Compressed.pdf' with open(output_path, 'wb') as f: writer.write(f) orig_size = os.path.getsize('/tmp/Chapter2_Autonomic_Pharmacology_Notes.pdf') comp_size = os.path.getsize(output_path) print(f'Original: {orig_size/1024:.1f} KB') print(f'Compressed: {comp_size/1024:.1f} KB') print(f'Reduction: {(1 - comp_size/orig_size)*100:.1f}%') "
python3 -c " from pypdf import PdfReader, PdfWriter import os reader = PdfReader('/tmp/Chapter2_Autonomic_Pharmacology_Notes.pdf') writer = PdfWriter() # Add pages to writer first, then compress for page in reader.pages: writer.add_page(page) # Now compress after pages are part of writer for page in writer.pages: page.compress_content_streams() writer.compress_identical_objects(remove_identicals=True, remove_orphans=True) output_path = '/home/daytona/workspace/ch2-notes/Chapter2_Autonomic_Pharmacology_Compressed.pdf' with open(output_path, 'wb') as f: writer.write(f) orig_size = os.path.getsize('/tmp/Chapter2_Autonomic_Pharmacology_Notes.pdf') comp_size = os.path.getsize(output_path) print(f'Original: {orig_size/1024:.1f} KB') print(f'Compressed: {comp_size/1024:.1f} KB') print(f'Reduction: {(1 - comp_size/orig_size)*100:.1f}%') "
Chapter2 Autonomic Pharmacology Compressed
PDF Document · PDF