Equipment and instruments 1 Computer with internet and printer 2 Spotlight (Shadowless ceiling fitted) 3 Needle holding Forceps(big-medium-small) 4 Dressing drums of Assorted size 5 Intravenous Stand 6 X-ray View Box(double) 7 Cheatle's Forceps 8 Mosquito forceps 9 Scissors straight (Tailor) 10 Scissors curved of different sizes 11 Stitch removal Scissors 12 Dissection forceps 13 Sinus Forceps 14 Probes-Assorted size 15 Pointed scissors 16 Gastric and Intestinal clamps (occlusive and crushing) 17 Abdominal Retractors 18 Tissue Forceps 19 Babcock's Forceps 20 Kocher's Forceps 21 Urethral Dilators 22 Rubber catheters of Assorted size 23 Metal Catheters 24 Suturing Needle (straight or curved) of Assorted size 25 Surgical Thread 26 Sponge holding forceps 27 Right Angle cholecystectomy Forceps 28 Stone holding forceps 29 Proctoscope with or without illuminator 30 Bougies (Megars) 31 Allies Forceps small 32 Allies Forceps big 33 Pile holding forceps 34 Artery Forceps small 35 Artery Forceps big 36 Artery Forceps Medium 37 Sigmoidoscope Rigid or flexible 38 Barron Pile's Gun 39 Laryngoscope Pediatric or Adult 40 Ambu Bag 41 Suction machine Electrical or Manual 42 Emergency light A 43 Skin grafting knife with handle 44 Surgical blades of different size 45 BP Handle of different size 46 Self-Retaining Retractor 47 Bone Drill Machine 48 Bone cutter 49 Giggly Saw 50 Scoop 51 Periosteum elevator 52 Maggler Forceps 53 Endotracheal Tubes of different sizes 54 High Pressure Autoclave 55 Fumigator 56 Refrigerator 57 Nitrous Oxide Cylinder 58 Hydrolic Operation Table 59 Anaesthesia Trolley or Boyle's Apparatus 60 Gabriel Syringe 61 Stretcher with trolley 62 Non mercury sphygmoman meter 63 Doyen's retractor 64 Green Armitage forceps 65 Sterilizer 66 Sim's speculum 67 Anterior vaginal wall retractor 68 Cusco's speculum 69 Uterine sound 70   Anterior Vaginal Wall retractor Make pdf all this instrument with their image there identification and there use with there sterilization

Reading File
Running Command

mkdir -p /home/daytona/workspace/surgical-instruments && ls /home/daytona/worksp…

Writing File

~/surgical-instruments/generate_pdf.py

#!/usr/bin/env python3
"""
Surgical Instruments Reference PDF Generator
Generates a comprehensive PDF with instrument images (from Wikimedia/public domain),
identification, uses, and sterilization methods.
"""

import os
import urllib.request
import urllib.error
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, Image as RLImage, PageBreak
)
from reportlab.platypus.flowables import Flowable
from reportlab.lib.utils import ImageReader
from io import BytesIO
import traceback

OUTPUT_PATH = "/home/daytona/workspace/surgical-instruments/Surgical_Instruments_Reference.pdf"

# ── Colour palette ─────────────────────────────────────────────────────────────
NAVY      = colors.HexColor("#1a3557")
TEAL      = colors.HexColor("#0d7377")
LIGHT_BG  = colors.HexColor("#eaf4fb")
GOLD      = colors.HexColor("#e8a020")
WHITE     = colors.white
GREY_LINE = colors.HexColor("#c0cdd8")
DARK_TXT  = colors.HexColor("#1c2b3a")
ROW_ALT   = colors.HexColor("#f3f9fc")

# ── Instrument data ────────────────────────────────────────────────────────────
# Each entry: (number, name, identification, uses, sterilization, image_url_or_None)
INSTRUMENTS = [
    (1, "Computer with Internet and Printer",
     "Standard desktop/laptop computer connected to broadband internet with an attached inkjet or laser printer.",
     "Maintaining patient records, scheduling, writing prescriptions, printing reports, accessing medical databases and e-resources.",
     "Wipe external surfaces with 70% isopropyl alcohol wipes. Do NOT autoclave. Keyboard and mouse: alcohol wipes or UV sterilization cabinet.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Personal_computer%2C_exploded_5.svg/400px-Personal_computer%2C_exploded_5.svg.png"),

    (2, "Spotlight (Shadowless Ceiling Fitted)",
     "Ceiling-mounted, multi-bulb or LED shadowless operating light; reflective bowl design eliminates shadows on the surgical field.",
     "Provides intense, shadow-free illumination of the operative field during surgeries and invasive procedures.",
     "Wipe lamp housing and handles with 70% alcohol or quaternary ammonium solution after each use. Handles may be wrapped in sterile drapes intra-operatively.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Shadowless_lamp.jpg/320px-Shadowless_lamp.jpg"),

    (3, "Needle Holding Forceps (Big / Medium / Small)",
     "Scissor-grip handles with a ratchet lock; short, stout jaws with cross-hatched tungsten carbide or stainless-steel inserts to grip curved suture needles securely.",
     "Holding and driving curved suture needles through tissue during wound closure and anastomosis. Size chosen based on needle and tissue depth.",
     "Autoclave at 134 °C / 3 bar for 3–4 minutes (pre-vacuum cycle) or 121 °C / 15 psi for 15 minutes. Lubricate ratchet after each cycle.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Needle_holder.jpg/320px-Needle_holder.jpg"),

    (4, "Dressing Drums (Assorted Sizes)",
     "Cylindrical stainless-steel containers with a perforated wall and sliding band; available in small, medium, and large sizes.",
     "Storing and sterilizing dressings, cotton wool, gauze swabs, and other soft goods used in wound dressing procedures.",
     "Pack loosely; autoclave at 121 °C for 30 minutes or 134 °C for 4 minutes with drums open. Close slats after sterilization; mark date and discard after 1 week if unopened.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/Dressing_drum.jpg/320px-Dressing_drum.jpg"),

    (5, "Intravenous Stand (IV Stand)",
     "Height-adjustable stainless-steel pole on a 5-castor wheeled base with 2–4 hooks at the top.",
     "Suspending IV fluid bags, blood bags, and infusion pumps during intravenous therapy; supports drip sets at the correct height for gravity flow.",
     "Wipe all metal surfaces with 70% alcohol or 1% sodium hypochlorite after each patient. Non-autoclavable. Base and wheels: disinfect regularly.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Intravenous_stand.jpg/200px-Intravenous_stand.jpg"),

    (6, "X-ray View Box (Double)",
     "Wall-mounted or portable lightbox with two fluorescent panels side-by-side; even, diffuse white backlighting; clips at top to hold films.",
     "Viewing and interpreting plain radiographs (X-ray films) — chest, abdomen, extremities — for diagnosis and surgical planning.",
     "Wipe surface with 70% alcohol. Panels are electrical equipment; do NOT immerse or autoclave.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/X-ray_view_box.jpg/320px-X-ray_view_box.jpg"),

    (7, "Cheatle's Forceps",
     "Long (25–30 cm), scissor-action forceps with ring handles and long straight jaws; no ratchet; made of stainless steel.",
     "Removing sterile instruments and dressings from sterilization containers without contaminating them. Used to transfer items to sterile field.",
     "Store in disinfectant solution (e.g., 2% glutaraldehyde) between uses or autoclave at 121 °C / 15 psi for 15 min. Change disinfectant solution daily. Dry storage preferred by modern guidelines.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Cheatle_forcep.jpg/320px-Cheatle_forcep.jpg"),

    (8, "Mosquito Forceps",
     "Miniature haemostatic clamp (10–12 cm) with fine serrated jaws; straight or curved; ratchet lock; delicate build.",
     "Clamping small blood vessels and delicate tissues; securing fine sutures; holding small structures in paediatric and microsurgery.",
     "Autoclave at 134 °C for 3 min (pre-vacuum) or 121 °C for 15 min. Ensure jaws are open during autoclaving to allow steam penetration.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Mosquito_forceps.jpg/320px-Mosquito_forceps.jpg"),

    (9, "Scissors Straight (Tailor / Mayo)",
     "Heavy, straight-bladed scissors with ring handles; blades may be sharp-sharp, sharp-blunt, or blunt-blunt; 14–17 cm length.",
     "Cutting sutures, gauze, drapes, and heavy tissues. The tailor scissors is the common straight mayo scissors used on surgical trolleys.",
     "Autoclave at 134 °C for 3–4 min. Keep blades lightly oiled. Inspect for nicks and alignment before each use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Mayo_scissors.jpg/320px-Mayo_scissors.jpg"),

    (10, "Scissors Curved (Assorted Sizes)",
     "Curved-bladed scissors of varying sizes (10–18 cm); Mayo curved or Metzenbaum; fine tips for delicate dissection.",
     "Dissecting and cutting tissues in deep body cavities where straight scissors cannot reach; cutting sutures; separating fascial planes.",
     "Autoclave at 134 °C for 3 min. Open blades during sterilization. Metzenbaum scissors are delicate — handle carefully.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Metzenbaum_scissors.jpg/320px-Metzenbaum_scissors.jpg"),

    (11, "Stitch Removal Scissors",
     "Small, lightweight scissors (11–12 cm) with one blade having a curved blunt hook to slide under suture; other blade sharp.",
     "Removing skin sutures post-operatively by slipping the hook under the suture loop and cutting cleanly without lifting the skin.",
     "Autoclave at 134 °C for 3 min or 121 °C for 15 min. Alternatively, single-use disposable versions are available.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Stitch_scissors.jpg/320px-Stitch_scissors.jpg"),

    (12, "Dissection Forceps (Tissue Thumb Forceps)",
     "Straight, spring-action thumb forceps; 12–18 cm; toothed (rat-tooth) or non-toothed tips; no ratchet.",
     "Grasping, holding, and manipulating tissues during dissection and suturing. Toothed for skin; non-toothed for bowel/vessels.",
     "Autoclave at 134 °C for 3 min. Inspect teeth alignment before use. Can also be cold-sterilized in 2% glutaraldehyde for 20 min.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Dissecting_forceps.jpg/320px-Dissecting_forceps.jpg"),

    (13, "Sinus Forceps",
     "Long, slender forceps with narrow, serrated jaws; slightly angled or curved; 14–18 cm; ratchet lock.",
     "Probing and opening sinuses and fistulous tracts; dilating sinus openings; introducing drains or packing into sinus cavities.",
     "Autoclave at 134 °C for 3 min or 121 °C for 15 min. Ensure lumen of any hollow channel is flushed before sterilization.",
     None),

    (14, "Probes (Assorted Sizes)",
     "Solid, smooth, blunt-tipped metal rods of varying diameters (malleable or rigid); silver, stainless steel, or plastic.",
     "Exploring wounds, fistulae, sinuses, and ducts; identifying tracts; guiding incisions; testing depth of cavities.",
     "Autoclave at 134 °C for 3–4 min. Malleable probes: straighten before packing. Disposable plastic probes available.",
     None),

    (15, "Pointed Scissors",
     "Scissors with both blades ending in sharp fine points; straight or curved; 11–14 cm.",
     "Precise cutting of thin tissues, peritoneum, and fascia; ophthalmic and fine plastic surgery procedures.",
     "Autoclave at 134 °C for 3 min. Store with tip protectors. Inspect points for burrs before each use.",
     None),

    (16, "Gastric and Intestinal Clamps (Occlusive and Crushing)",
     "Long-handled clamps with straight or angled serrated jaws; crushing clamps (Payr) have heavy serrations; occlusive (intestinal) clamps have fine longitudinal serrations and rubber inserts.",
     "Occluding bowel lumen during resection: crushing clamps crush the bowel at the resection line; occlusive clamps prevent spillage from the bowel ends without crushing (non-crushing).",
     "Autoclave at 134 °C for 4 min (pre-vacuum). Remove rubber inserts and autoclave separately. Inspect serrations after each use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Intestinal_clamps.jpg/320px-Intestinal_clamps.jpg"),

    (17, "Abdominal Retractors",
     "Large, flat or curved blades attached to a handle or frame; Deaver retractor (curved blade), Morris retractor (right-angle blade), Balfour self-retaining retractor (frame with interchangeable blades).",
     "Retracting abdominal wall and viscera to provide surgical exposure during laparotomy; maintaining a clear operative field.",
     "Autoclave at 134 °C for 4 min. Heavy instruments — use peel packs or rigid perforated trays to prevent damage to other instruments.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Deaver_retractor.jpg/320px-Deaver_retractor.jpg"),

    (18, "Tissue Forceps (Allis Forceps variant)",
     "Ratchet-lock forceps with multiple fine interlocking teeth at the tip; 15–20 cm; straight.",
     "Grasping and holding fascia, peritoneum, and tough tissues during dissection; securing drapes to skin; holding wound edges.",
     "Autoclave at 134 °C for 3 min. Inspect teeth alignment. Do not use on delicate bowel or vascular structures.",
     None),

    (19, "Babcock's Forceps",
     "Non-crushing, ring-tip grasping forceps; broad, flared, smooth triangular jaws form a circle when closed; 20–23 cm.",
     "Grasping and holding bowel, fallopian tubes, appendix, and other hollow viscera without crushing; also used to hold ureter.",
     "Autoclave at 134 °C for 3–4 min. Ensure jaws close properly and tips align. Do not use with heavy traction on delicate bowel.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Babcock_forceps.jpg/320px-Babcock_forceps.jpg"),

    (20, "Kocher's Forceps",
     "Heavy haemostatic clamps with transverse serrations along the full length of the jaws and a single sharp tooth at the tip; straight or curved; 14–20 cm; ratchet lock.",
     "Clamping thick, tough tissues (fasciae, tendons, ligaments); securing pedicles; holding bone fragments. The tooth prevents slippage on tough tissue.",
     "Autoclave at 134 °C for 3 min. Inspect teeth for damage. Keep ratchet open during sterilization.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Kocher_clamp.jpg/320px-Kocher_clamp.jpg"),

    (21, "Urethral Dilators",
     "Graduated, curved or straight metal bougies (French scale); smooth, tapered tips; stainless steel or rigid plastic.",
     "Dilating urethral strictures; calibrating urethral diameter; facilitating passage of catheters in stenosed urethras.",
     "Autoclave at 134 °C for 3 min or cold-soak in 2% glutaraldehyde for 20–30 min. Rinse with sterile water before use.",
     None),

    (22, "Rubber Catheters (Assorted Sizes)",
     "Flexible tubes of natural rubber or latex; Foley (balloon-tip, 2-way or 3-way), Nelaton (plain), and Robinson types; sized by French gauge (8–30 Fr).",
     "Draining urinary bladder (Foley); intermittent catheterization; post-operative urine monitoring; irrigation of bladder.",
     "Single-use disposable (preferred). Reusable rubber catheters: boil for 20 min or autoclave at 121 °C / 15 psi for 15 min. Latex degrades with repeated autoclaving.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Foley_catheter.jpg/320px-Foley_catheter.jpg"),

    (23, "Metal Catheters",
     "Rigid stainless-steel catheter; curved (male) or short and slightly curved (female); smooth, rounded eyelets at tip; sizes 10–18 Fr.",
     "Catheterizing male patients when rubber catheter cannot be passed (urethral stricture); draining acute urinary retention; introducing instruments into bladder.",
     "Autoclave at 134 °C for 3–4 min. Inspect tip and eyelets for burrs before use. Chemical sterilization: 2% glutaraldehyde 20 min.",
     None),

    (24, "Suturing Needles (Straight and Curved, Assorted Sizes)",
     "Surgical needles: body (straight or curved 1/4, 3/8, 1/2, 5/8 circle), eye (eyed or atraumatic/swaged), point (cutting, reverse-cutting, taper, blunt); sized 3–0 to 6–0 and larger.",
     "Passing suture material through tissues to approximate wound edges, anastomose structures, ligate vessels, and close body cavities.",
     "Single-use atraumatic needles (pre-attached sutures): discard after one use. Reusable eyed needles: autoclave at 134 °C for 3 min. Inspect point sharpness and needle integrity before each use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/Surgical_needle_types.jpg/320px-Surgical_needle_types.jpg"),

    (25, "Surgical Thread (Suture Material)",
     "Available as absorbable (catgut, polyglactin/Vicryl, poliglecaprone/Monocryl) and non-absorbable (silk, nylon, polypropylene/Prolene, stainless steel wire); monofilament or braided; sizes USP 6–0 to 5.",
     "Approximating wound edges, ligating vessels and pedicles, closing body cavities, anastomosing tubular structures, attaching prostheses.",
     "Supplied sterile; single-use. Do not re-sterilize. Store in cool, dry conditions away from direct light. Check expiry before use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Suture_types.jpg/320px-Suture_types.jpg"),

    (26, "Sponge Holding Forceps",
     "Long (25–30 cm), ratchet-lock forceps with large oval fenestrated (ring) jaws; straight; strong spring handles.",
     "Holding gauze swabs and sponges to swab the operative field; applying antiseptics to skin pre-operatively; holding packing material.",
     "Autoclave at 134 °C for 3–4 min. Ensure gauze is removed before sterilization. Inspect jaws for corrosion.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Sponge_holding_forceps.jpg/320px-Sponge_holding_forceps.jpg"),

    (27, "Right Angle Cholecystectomy Forceps (Mixter Forceps)",
     "Haemostatic clamp with jaws angled at 90° to the handle; serrated jaws; ratchet lock; 18–23 cm.",
     "Dissecting around cystic duct and cystic artery during cholecystectomy; passing ligatures around tubular structures; right-angle dissection in confined spaces.",
     "Autoclave at 134 °C for 3–4 min. Ensure jaws align precisely after sterilization. Keep in angled position during packing.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Mixter_forceps.jpg/320px-Mixter_forceps.jpg"),

    (28, "Stone Holding Forceps",
     "Heavy, curved or straight forceps with concave, fenestrated or serrated jaws designed to grasp calculi; ratchet lock.",
     "Grasping and extracting calculi (gallstones, renal stones) from common bile duct, gallbladder, and kidney during open stone surgery.",
     "Autoclave at 134 °C for 3–4 min. Inspect jaw surfaces for chips. Flush any hollow chambers before packing.",
     None),

    (29, "Proctoscope (with/without Illuminator)",
     "Hollow, straight, rigid metal or plastic tube (7–10 cm long, 2–3 cm diameter) with an obturator; may have attached light source.",
     "Visualizing the anal canal and lower rectum; diagnosing haemorrhoids, fissures, fistulae, polyps, and rectal tumours; performing banding of piles.",
     "Metal: autoclave at 134 °C for 3 min. Plastic/disposable: single use. Detachable light source: wipe with alcohol.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Proctoscope.jpg/320px-Proctoscope.jpg"),

    (30, "Bougies (Hegar / Maloney / Tucker-McLane)",
     "Tapered, smooth-tipped metal or semi-rigid plastic dilators; graded by French or Hegar number; straight or curved.",
     "Dilating oesophageal, anal, cervical, and urethral strictures; calibrating lumen diameter; facilitating endoscopy through a narrowed orifice.",
     "Metal bougies: autoclave at 134 °C for 3 min. Plastic/disposable: discard after use. Inspect tip for deformity before use.",
     None),

    (31, "Allis Forceps Small",
     "Ratchet-lock tissue forceps; small size (13–15 cm); multiple fine interlocking teeth at tip forming a serrated edge.",
     "Grasping fascia, peritoneum, appendix stump, and superficial tissue; holding small specimens; securing wound edges.",
     "Autoclave at 134 °C for 3 min. Inspect teeth alignment and ratchet function before each use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Allis_clamp.jpg/320px-Allis_clamp.jpg"),

    (32, "Allis Forceps Big",
     "Same design as small Allis but larger (18–22 cm); heavier build; broader jaws.",
     "Grasping and retracting large masses of tissue such as hernial sac, stomach wall, colon; holding dura and peritoneum during laparotomy.",
     "Autoclave at 134 °C for 3–4 min. Keep in open position during steam cycle.",
     None),

    (33, "Pile Holding Forceps",
     "Short, straight forceps with smooth or lightly serrated spoon-shaped jaws; ratchet lock; 14–16 cm.",
     "Grasping and holding haemorrhoidal tissue during haemorrhoidectomy and ligation procedures.",
     "Autoclave at 134 °C for 3 min. Inspect jaw surfaces for corrosion.",
     None),

    (34, "Artery Forceps Small (Mosquito / Fine Crile)",
     "Small haemostatic clamp (12–14 cm); transversely serrated jaws; straight or curved; ratchet lock.",
     "Clamping small arterioles and venules; securing fine sutures; controlling minor bleeding in superficial wounds.",
     "Autoclave at 134 °C for 3 min. Ensure ratchet open during sterilization cycle.",
     None),

    (35, "Artery Forceps Big (Rochester-Carmalt / Kelly Large)",
     "Large haemostatic clamp (18–24 cm); fully serrated jaws with or without longitudinal groves; ratchet lock.",
     "Clamping large blood vessels, pedicles (ovarian, splenic), and vascular structures during major surgery.",
     "Autoclave at 134 °C for 4 min (pre-vacuum). Heavy instruments — use dedicated trays to prevent damage.",
     None),

    (36, "Artery Forceps Medium (Crile / Kelly)",
     "Medium haemostatic clamp (14–16 cm); half or fully serrated jaws; straight or curved; ratchet lock.",
     "Most commonly used all-purpose haemostatic clamp for controlling bleeding from medium-sized vessels during general surgery.",
     "Autoclave at 134 °C for 3 min. Keep jaws open during packing and sterilization.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Kelly_forceps.jpg/320px-Kelly_forceps.jpg"),

    (37, "Sigmoidoscope (Rigid or Flexible)",
     "Rigid: hollow metal/plastic tube 25–30 cm × 1.9–2.5 cm with obturator and light source. Flexible: video-endoscope with angulation controls; 60–70 cm working length.",
     "Visualizing sigmoid colon and rectum; diagnosing polyps, carcinoma, IBD, diverticular disease; obtaining biopsies; removing polyps.",
     "Rigid metal: autoclave at 134 °C for 3 min. Rigid disposable: single use. Flexible scope: high-level disinfection with 2% glutaraldehyde 20 min or automated endoscope reprocessor (AER). Aldex or OPA may be used.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Sigmoidoscope.jpg/320px-Sigmoidoscope.jpg"),

    (38, "Barron Pile's Banding Gun (Ligator)",
     "Pistol-grip device with a hollow drum loaded with rubber bands; drum fits over proctoscope; trigger fires rubber band.",
     "Rubber band ligation of internal haemorrhoids (1st, 2nd, and some 3rd degree); minimally invasive outpatient treatment for piles.",
     "Disposable single-use versions preferred. Reusable metal: autoclave at 134 °C for 3 min. Ensure rubber bands are loaded just before use.",
     None),

    (39, "Laryngoscope (Paediatric and Adult)",
     "Handle (battery compartment) + interchangeable blades: Miller (straight, for neonates/infants) and Macintosh (curved, for adults); bright LED or fibre-optic light; blade sizes 0–4.",
     "Direct laryngoscopy for visualizing the glottis and vocal cords during tracheal intubation; airway management in emergencies and anaesthesia.",
     "Remove blade from handle. Blade: autoclave at 134 °C for 3 min OR high-level disinfect with 2% glutaraldehyde. Handle: wipe with 70% alcohol. Check light function before each use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Laryngoscope_Macintosh.jpg/320px-Laryngoscope_Macintosh.jpg"),

    (40, "Ambu Bag (BVM Resuscitator)",
     "Self-inflating bag-valve-mask device: silicone or PVC mask (sizes 0–5), one-way valve, self-inflating reservoir bag, optional PEEP valve and oxygen reservoir.",
     "Manual ventilation of apnoeic patients; pre-oxygenation before intubation; respiratory support during cardiac arrest and transport.",
     "Single-use disposable preferred. Reusable: disassemble all components; autoclave at 121 °C / 15 psi for 15 min (check manufacturer guidance — some components latex or silicone). Alternatively, high-level disinfection with glutaraldehyde 2% for 20 min, rinse with sterile water.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Ambu_bag.jpg/320px-Ambu_bag.jpg"),

    (41, "Suction Machine (Electrical or Manual)",
     "Electrical: motor-driven vacuum pump, collection bottle, tubing, and Yankauer/soft suction catheter. Manual: foot-pump or hand-pump suction device for field use.",
     "Removing blood, secretions, vomit, and fluid from operative field and airway; clearing airway in unconscious patients; post-operative wound drainage.",
     "Suction catheters: single-use. Collection bottle: disinfect with 1% sodium hypochlorite, clean and dry. Tubing: replace between cases. External surfaces: wipe with 70% alcohol.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Suction_machine.jpg/320px-Suction_machine.jpg"),

    (42, "Emergency Light",
     "Battery-backed LED fluorescent or LED panel light; automatic activation on power failure; wall- or ceiling-mounted.",
     "Providing emergency illumination in operation theatre and clinical areas during power outages to ensure patient safety and continuation of procedures.",
     "Wipe housing with 70% alcohol. Test battery back-up monthly. Non-autoclavable.",
     None),

    (43, "Skin Grafting Knife (Humby / Watson / Braithwaite Knife) with Handle",
     "Long, flat blade mounted in a metal handle with an adjustable roller to set thickness; blade width 10–20 cm; guarded edge.",
     "Harvesting split-thickness skin grafts (STSG) from donor sites for reconstructive surgery and burn wound coverage.",
     "Autoclave at 134 °C for 3 min (for reusable blades/handles). Disposable blade: single use. Check roller setting and blade edge before harvesting.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Humby_knife.jpg/320px-Humby_knife.jpg"),

    (44, "Surgical Blades (Assorted Sizes)",
     "Disposable carbon-steel or stainless-steel blades: No. 10 (large belly), 11 (pointed), 12 (hooked), 15 (small belly), 20–25 (larger variants); fit corresponding BP handles.",
     "Incising skin and tissues; opening abscess; excising lesions; making stab incisions. Blade choice depends on incision type.",
     "Single-use only. Dispose in sharps container immediately after use. Never recap. Blades must NEVER be re-sterilized.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/Surgical_blades.jpg/320px-Surgical_blades.jpg"),

    (45, "BP Handle (Scalpel Handle) — Assorted Sizes",
     "Stainless-steel handle: No. 3 (for small blades 10–15), No. 4 (for large blades 20–25), No. 7 (slender, for fine work). Fit blade with artery forceps.",
     "Holding surgical blades to make precise skin and tissue incisions during surgery and minor procedures.",
     "Autoclave at 134 °C for 3 min after removing and discarding used blade. Pack in instrument tray or peel pouch.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Scalpel_handle.jpg/320px-Scalpel_handle.jpg"),

    (46, "Self-Retaining Retractor (Weitlaner / Gelpi / Balfour)",
     "Spring-loaded or ratcheted frame with outward-facing prongs or blades that stay open without assistant help; various sizes.",
     "Maintaining wound exposure without a surgical assistant holding retractors; used in orthopaedic, neurosurgical, and general surgical wounds.",
     "Autoclave at 134 °C for 3–4 min. Lubricate ratchet mechanism after each cycle. Inspect prongs for bending.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Weitlaner_retractor.jpg/320px-Weitlaner_retractor.jpg"),

    (47, "Bone Drill Machine",
     "Electric or battery-powered rotary drill with Jacobs or AO-coupling chuck; surgical grade stainless-steel drill bits (Kirchner wires, cortical/cancellous bits); orthopedic-specific.",
     "Drilling holes in bone for screws, wires, and plates in fracture fixation; preparing bone for prosthesis insertion; making burr holes in neurosurgery.",
     "Handpiece: autoclave at 134 °C for 4 min (manufacturer-validated). Drill bits: autoclave 134 °C for 3 min. Flush coolant channels before sterilization. Lubricate per manufacturer guidance.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Surgical_drill.jpg/320px-Surgical_drill.jpg"),

    (48, "Bone Cutter (Liston / Stille Bone Forceps)",
     "Heavy-duty double-action plier-type instrument with cutting jaws; angled or straight; 18–25 cm; spring-return handles.",
     "Cutting and trimming cortical and cancellous bone during fracture fixation, amputation, and arthroplasty procedures.",
     "Autoclave at 134 °C for 4 min (pre-vacuum). Lubricate pivot joint. Inspect cutting edges for nicks after each use.",
     None),

    (49, "Gigli Saw",
     "Flexible, twisted stainless-steel wire saw with loop handles at each end; 30–45 cm cutting length.",
     "Cutting through bone in locations inaccessible to standard saws (skull burr-hole to craniotomy, amputation through femur/tibia, pelvic osteotomy).",
     "Single-use disposable (most modern sets). Reusable: autoclave at 134 °C for 3 min. Inspect wire for fraying before use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Gigli_saw.jpg/320px-Gigli_saw.jpg"),

    (50, "Scoop (Volkmann Spoon / Bone Scoop)",
     "Long-handled instrument with a rounded, spoon-shaped or oval cup at tip; may be sharp or blunt; various sizes.",
     "Scooping out necrotic bone (sequestrum removal in osteomyelitis); curettage of bone cavities, cysts, and granulation tissue.",
     "Autoclave at 134 °C for 3 min. Inspect cutting edge for sharpness and defects.",
     None),

    (51, "Periosteum Elevator (Rugine / Cobb Elevator)",
     "Flat, broad-bladed instrument with bevelled edge; straight or slightly curved handle; stainless steel.",
     "Stripping periosteum from bone surface before bone cutting, plating, or grafting; separating soft tissue from bone with minimal damage.",
     "Autoclave at 134 °C for 3 min. Inspect blade edge for nicks. Pack flat to protect blade.",
     None),

    (52, "Magill Forceps",
     "Angled (offset), ring-handled forceps; wide, rounded jaws; no teeth; 25–30 cm; angled at approximately 45°.",
     "Manipulating endotracheal tubes and nasogastric tubes in the pharynx during intubation; removing pharyngeal foreign bodies under laryngoscopy.",
     "Autoclave at 134 °C for 3 min or high-level disinfection with 2% glutaraldehyde 20 min. Inspect hinge.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/Magill_forceps.jpg/320px-Magill_forceps.jpg"),

    (53, "Endotracheal Tubes (Assorted Sizes)",
     "Curved PVC or silicone tube with bevelled Murphy eye tip, inflatable low-pressure cuff (adults), pilot balloon, radiopaque line, cm markings; ID 2.5–9.0 mm (age-based sizing: ID = age/4 + 4 for children).",
     "Securing the airway during general anaesthesia; mechanical ventilation in ICU; protecting airway from aspiration; delivering anaesthetic gases.",
     "Single-use disposable (standard practice). Reusable silicone ET tubes: autoclave at 121 °C for 15 min. Check cuff integrity before use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Endotracheal_tube.jpg/320px-Endotracheal_tube.jpg"),

    (54, "High Pressure Autoclave",
     "Stainless-steel pressure vessel with door seal, steam generator, vacuum pump, pressure/temperature gauges, and programmable controller; available in bench-top and floor-standing models.",
     "Steam sterilization of all heat- and moisture-stable surgical instruments, dressings, and equipment; gravity or pre-vacuum cycles; validated sterility assurance level (SAL) 10⁻⁶.",
     "The autoclave IS the sterilization equipment. Validate with Bowie-Dick test (pre-vacuum) daily. Biological indicator (Geobacillus stearothermophilus) weekly. Regular descaling, door gasket inspection, and pressure gauge calibration.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Medical_autoclave.jpg/320px-Medical_autoclave.jpg"),

    (55, "Fumigator (Formaldehyde Fumigator / Fogger)",
     "Electrical heating unit or spray fogger used to volatilize formaldehyde (40% formalin) or hydrogen peroxide solution in a sealed room.",
     "Terminal disinfection of operation theatres and isolation rooms; decontaminating surfaces after infectious cases; space disinfection when surfaces cannot be wiped (complex geometry).",
     "Equipment itself: wipe exterior with 70% alcohol. Follow strict safety protocols (PPE, sealed room, neutralization with ammonia after fumigation). Note: Formaldehyde is carcinogenic — HPV fumigation increasingly preferred.",
     None),

    (56, "Refrigerator (Medical/Pharmaceutical)",
     "Temperature-controlled cabinet maintaining 2–8 °C (vaccine refrigerator) or -20 °C (freezer); frost-free; alarm system; lockable.",
     "Storing vaccines, blood products, insulin, skin grafts, donor corneas, and temperature-sensitive medications.",
     "Non-autoclavable. Clean interior with 70% alcohol or sodium hypochlorite 0.5% monthly. Defrost and clean coils regularly. Temperature log mandatory.",
     None),

    (57, "Nitrous Oxide Cylinder",
     "Blue (international) or blue-shouldered cylinder; compressed gas at 750 psi (51 bar); fitted with pin-indexed valve (Compressed Gas Association pin index 3-5 for N₂O); requires pressure regulator.",
     "Anaesthetic adjuvant (50% N₂O + 50% O₂ = Entonox for analgesia); co-induction agent to reduce requirement for volatile anaesthetics; dental procedures.",
     "Cylinder is not sterilized. Handle with care: store upright, chain to wall, away from heat. Regulator and delivery tubing: single-use or autoclave at 121 °C. Cylinder exterior: wipe with damp cloth.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Nitrous_oxide_cylinder.jpg/320px-Nitrous_oxide_cylinder.jpg"),

    (58, "Hydraulic Operating Table",
     "Motorized or manually hydraulic table with modular sections (head, back, leg, arm boards); radiolucent top; stainless-steel frame; Trendelenburg/reverse Trendelenburg, lateral tilt, and height adjustment.",
     "Supporting the patient in optimal position during surgery; allowing repositioning without moving the patient; accommodating accessories (lithotomy poles, arm boards, shoulder supports).",
     "Wipe mattress with 70% sodium hypochlorite or quaternary ammonium compound after each case. Frame: 70% alcohol. Non-autoclavable. Hydraulic system: serviced annually.",
     None),

    (59, "Anaesthesia Machine (Boyle's Apparatus / Anaesthesia Trolley)",
     "Integrated machine with medical gas pipeline connections/cylinders, flowmeters, vapourisers (isoflurane, sevoflurane), breathing circuit, ventilator, and multi-parameter monitor.",
     "Delivering precise concentrations of anaesthetic gases and oxygen to maintain general anaesthesia; mechanical ventilation of the anaesthetised patient.",
     "Breathing circuit and mask: autoclave or single-use. Vapouriser exterior: wipe with alcohol. CO₂ absorber: replace as per colour indicator. Machine check per AAGBI/manufacturer protocol before each list.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Anaesthesia_machine.jpg/320px-Anaesthesia_machine.jpg"),

    (60, "Gabriel Syringe",
     "Large-capacity (20–100 mL) glass or metal Higginson-type bulb syringe or piston syringe with long nozzle for rectal lavage.",
     "Administering enemas; washing out the rectum before proctoscopy or bowel surgery; evacuating faecal impaction.",
     "Glass/metal: boil for 20 min or autoclave at 121 °C for 15 min. Rubber bulb: soak in 2% glutaraldehyde 20 min then rinse. Single-use enema kits preferred.",
     None),

    (61, "Stretcher with Trolley",
     "Collapsible or non-collapsible canvas/padded stretcher on a wheeled aluminium or stainless-steel frame; height-adjustable with head-end elevation; side rails; IV pole attachment.",
     "Transporting patients within and between hospital areas; emergency evacuation; receiving and holding patients in OT reception.",
     "Mattress: wipe with 1% sodium hypochlorite or quaternary ammonium after each patient. Frame: 70% alcohol. Non-autoclavable. Wheels: clean regularly.",
     None),

    (62, "Non-Mercury Sphygmomanometer (Aneroid/Digital)",
     "Aneroid: gauge, inflation bulb, cuff (Velcro, various widths), tubing. Digital: oscillometric sensor, LCD display, auto-inflate. Replaces mercury to eliminate Hg hazard.",
     "Measuring arterial blood pressure for clinical assessment, anaesthetic monitoring, and cardiovascular examination.",
     "Cuff: wipe with 70% alcohol between patients (or use disposable cuffs). Gauge/device: wipe exterior with alcohol. Non-autoclavable. Calibrate aneroid gauges annually.",
     None),

    (63, "Doyen's Retractor",
     "Large curved blade (20–25 cm) with a right-angle bend at the handle end; flat, smooth blade; one of the largest abdominal retractors.",
     "Retracting the bladder and uterus inferiorly during Caesarean section, hysterectomy, and pelvic surgery to expose the lower uterine segment.",
     "Autoclave at 134 °C for 4 min. Pack in dedicated tray. Inspect blade surface for corrosion.",
     None),

    (64, "Green-Armytage Forceps",
     "Angled, broad-jawed, non-crushing haemostatic forceps; jaws have a distinctive broad, flat, angled curvature; 20–24 cm.",
     "Controlling bleeding from the cut edges of the lower uterine segment during Caesarean section; haemostasis in obstetric surgery.",
     "Autoclave at 134 °C for 3–4 min. Inspect jaw alignment. Keep in designated Caesarean section set.",
     None),

    (65, "Sterilizer (Boiler / Hot-Air Oven / Plasma Sterilizer)",
     "Boiler/Boiling water sterilizer: stainless-steel tank with electric heater. Hot-air oven: dry heat cabinet at 160–170 °C. Plasma: low-temperature hydrogen peroxide gas plasma unit.",
     "Sterilizing instruments where steam is not suitable: dry heat for sharp metal instruments (oils, powders), hot-air for glass; plasma for heat/moisture sensitive items (cameras, endoscopes).",
     "Hot-air oven: 160 °C for 60 min or 170 °C for 40 min. Plasma: per manufacturer protocol (approx 54 min cycle). Boiler: 100 °C for 20 min (disinfection, NOT sterilization). Validate with appropriate biological/chemical indicators.",
     None),

    (66, "Sim's Speculum",
     "Double-ended, duck-bill shaped metal speculum with two offset, curved blades; sizes small, medium, large; held by assistant or self-retaining.",
     "Exposing the vaginal walls and cervix for examination; vaginal repair (anterior/posterior colporrhaphy); inserting IUCDs; collecting cervical swabs.",
     "Autoclave at 134 °C for 3 min or boil for 20 min. Alternatively high-level disinfect in 2% glutaraldehyde 20 min. Dry and store in antiseptic tray.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Sims_Speculum.jpg/320px-Sims_Speculum.jpg"),

    (67, "Anterior Vaginal Wall Retractor",
     "Flat, curved, broad-bladed retractor sized for vaginal use; smooth, polished surface; angled handle.",
     "Retracting the anterior vaginal wall to expose the posterior vaginal wall and cervix; facilitating posterior colporrhaphy and vault procedures.",
     "Autoclave at 134 °C for 3 min. Inspect blade surface for nicks. Part of gynaecological instrument set.",
     None),

    (68, "Cusco's Speculum (Bivalve Vaginal Speculum)",
     "Two-bladed self-retaining bivalve speculum; thumb screw or ratchet opens and locks blades apart; metal (Graves type) or plastic disposable; sizes S/M/L.",
     "Self-retaining exposure of the cervix for Pap smear, IUCD insertion/removal, cervical biopsy, colposcopy, and visual inspection of the cervix.",
     "Metal: autoclave at 134 °C for 3 min. Plastic: single-use, discard. Check screw mechanism before use.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Cuscos_speculum.jpg/320px-Cuscos_speculum.jpg"),

    (69, "Uterine Sound",
     "Thin, malleable, graduated (cm markings) metal probe with a small bulbous tip and a curved handle; 30 cm long; stainless steel.",
     "Measuring the depth and direction of the uterine cavity before IUCD insertion, D&C, and hysteroscopy; detecting uterine anomalies.",
     "Autoclave at 134 °C for 3 min. Inspect tip for deformity. Keep in gynaecology tray. Single-use disposable versions available.",
     "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Uterine_sound.jpg/320px-Uterine_sound.jpg"),

    (70, "Anterior Vaginal Wall Retractor (Auvard Weighted Speculum)",
     "Heavy, self-retaining posterior vaginal retractor with a lead/metal weight at the lower end; a wide blade at the top retracts the posterior wall while gravity holds it in place.",
     "Providing self-retaining exposure of the anterior vaginal wall and cervix during anterior colporrhaphy, Manchester repair, and vaginal hysterectomy without requiring an assistant.",
     "Autoclave at 134 °C for 3 min. Heavy instrument — handle carefully. Inspect blade for corrosion and lead weight integrity.",
     None),
]

# ── Image download helper ──────────────────────────────────────────────────────
IMAGE_DIR = "/home/daytona/workspace/surgical-instruments/images"
os.makedirs(IMAGE_DIR, exist_ok=True)

def fetch_image_bytes(url, name):
    if url is None:
        return None
    safe_name = name.replace(" ", "_").replace("/", "-")[:40]
    local_path = os.path.join(IMAGE_DIR, safe_name + ".jpg")
    if os.path.exists(local_path):
        return local_path
    try:
        req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
        with urllib.request.urlopen(req, timeout=10) as resp:
            data = resp.read()
        with open(local_path, "wb") as f:
            f.write(data)
        return local_path
    except Exception as e:
        print(f"  [image skip] {safe_name}: {e}")
        return None

# ── Build PDF ──────────────────────────────────────────────────────────────────
def build_pdf():
    doc = SimpleDocTemplate(
        OUTPUT_PATH,
        pagesize=A4,
        rightMargin=1.5*cm, leftMargin=1.5*cm,
        topMargin=1.5*cm, bottomMargin=1.5*cm,
        title="Surgical Instruments Reference Guide",
        author="Medical Instruments Reference"
    )

    styles = getSampleStyleSheet()

    # Custom styles
    title_style = ParagraphStyle(
        "MainTitle", parent=styles["Title"],
        fontSize=26, textColor=WHITE,
        spaceAfter=6, fontName="Helvetica-Bold",
        alignment=TA_CENTER
    )
    subtitle_style = ParagraphStyle(
        "SubTitle", parent=styles["Normal"],
        fontSize=13, textColor=LIGHT_BG,
        spaceAfter=4, fontName="Helvetica",
        alignment=TA_CENTER
    )
    cat_style = ParagraphStyle(
        "Category", parent=styles["Normal"],
        fontSize=11, textColor=WHITE,
        fontName="Helvetica-Bold", alignment=TA_CENTER
    )
    num_style = ParagraphStyle(
        "Number", parent=styles["Normal"],
        fontSize=22, textColor=GOLD,
        fontName="Helvetica-Bold", alignment=TA_CENTER
    )
    inst_name_style = ParagraphStyle(
        "InstName", parent=styles["Normal"],
        fontSize=14, textColor=NAVY,
        fontName="Helvetica-Bold", spaceAfter=4, leading=18
    )
    label_style = ParagraphStyle(
        "Label", parent=styles["Normal"],
        fontSize=9, textColor=TEAL,
        fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2
    )
    body_style = ParagraphStyle(
        "Body", parent=styles["Normal"],
        fontSize=9, textColor=DARK_TXT,
        fontName="Helvetica", leading=13, spaceAfter=2, alignment=TA_JUSTIFY
    )
    footer_style = ParagraphStyle(
        "Footer", parent=styles["Normal"],
        fontSize=8, textColor=colors.HexColor("#888888"),
        fontName="Helvetica", alignment=TA_CENTER
    )

    story = []

    # ── Cover page ──────────────────────────────────────────────────────────────
    cover_data = [[Paragraph("SURGICAL INSTRUMENTS", title_style)],
                  [Paragraph("Reference Guide", subtitle_style)],
                  [Paragraph("Identification • Uses • Sterilization Methods", subtitle_style)],
                  [Spacer(1, 0.3*cm)],
                  [Paragraph("70 Essential Instruments for Surgical Practice", cat_style)],
                  [Spacer(1, 0.5*cm)],
                  [Paragraph("Compiled for Nursing & Surgical Staff | July 2026", footer_style)]]

    cover_table = Table(cover_data, colWidths=[doc.width])
    cover_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), NAVY),
        ("TOPPADDING",  (0,0), (-1,-1), 16),
        ("BOTTOMPADDING", (0,0), (-1,-1), 12),
        ("LEFTPADDING",   (0,0), (-1,-1), 24),
        ("RIGHTPADDING",  (0,0), (-1,-1), 24),
        ("ROUNDEDCORNERS", (0,0), (-1,-1), [8,8,8,8]),
    ]))
    story.append(cover_table)
    story.append(Spacer(1, 0.8*cm))

    # Category legend boxes
    categories = [
        ("General Surgical Instruments", "Items 1–36"),
        ("Emergency & Airway Equipment", "Items 37–42"),
        ("Orthopaedic & Anaesthetic", "Items 43–59"),
        ("Gynaecological Instruments", "Items 60–70"),
    ]
    cat_items = []
    for cat_name, cat_range in categories:
        cat_items.append([
            Paragraph(f"<b>{cat_name}</b><br/><font size=8>{cat_range}</font>", cat_style)
        ])
    cat_table = Table(
        [cat_items],
        colWidths=[doc.width/4]*4
    )
    cat_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (0,0), TEAL),
        ("BACKGROUND", (1,0), (1,0), NAVY),
        ("BACKGROUND", (2,0), (2,0), colors.HexColor("#1a5c38")),
        ("BACKGROUND", (3,0), (3,0), colors.HexColor("#7a1a1a")),
        ("TOPPADDING",    (0,0), (-1,-1), 10),
        ("BOTTOMPADDING", (0,0), (-1,-1), 10),
        ("LEFTPADDING",   (0,0), (-1,-1), 8),
        ("RIGHTPADDING",  (0,0), (-1,-1), 8),
    ]))
    story.append(cat_table)
    story.append(Spacer(1, 0.5*cm))

    # How to use guide
    guide_data = [
        [Paragraph("<b>HOW TO USE THIS GUIDE</b>", ParagraphStyle("gh", parent=label_style, fontSize=10, textColor=NAVY))],
        [Paragraph(
            "Each instrument entry contains: (1) Identification — physical description to help recognise the instrument; "
            "(2) Uses — clinical applications in surgical practice; "
            "(3) Sterilization — validated method to achieve sterility before use. "
            "Images are representative; actual instruments may vary by manufacturer.",
            body_style
        )]
    ]
    guide_table = Table(guide_data, colWidths=[doc.width])
    guide_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_BG),
        ("BOX", (0,0), (-1,-1), 1, TEAL),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ]))
    story.append(guide_table)
    story.append(PageBreak())

    # ── Instrument entries ──────────────────────────────────────────────────────
    for num, name, identification, uses, sterilization, img_url in INSTRUMENTS:
        print(f"Processing {num}. {name}")

        # Fetch image
        img_path = fetch_image_bytes(img_url, f"{num:02d}_{name}")

        # Number badge + name
        left_col = [
            Table([[Paragraph(str(num), num_style)]], colWidths=[1.6*cm],
                  style=[
                      ("BACKGROUND", (0,0), (-1,-1), NAVY),
                      ("ROUNDEDCORNERS", (0,0), (-1,-1), [6,6,6,6]),
                      ("TOPPADDING",    (0,0), (-1,-1), 6),
                      ("BOTTOMPADDING", (0,0), (-1,-1), 6),
                  ]),
        ]

        right_col = [Paragraph(name, inst_name_style)]

        header_table = Table(
            [[left_col[0], right_col[0]]],
            colWidths=[1.9*cm, doc.width - 1.9*cm]
        )
        header_table.setStyle(TableStyle([
            ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
            ("TOPPADDING",    (0,0), (-1,-1), 2),
            ("BOTTOMPADDING", (0,0), (-1,-1), 2),
            ("LEFTPADDING",   (0,0), (-1,-1), 0),
            ("RIGHTPADDING",  (0,0), (-1,-1), 0),
        ]))

        # Content rows
        content_rows = [
            [Paragraph("IDENTIFICATION", label_style), Paragraph(identification, body_style)],
            [Paragraph("USES", label_style), Paragraph(uses, body_style)],
            [Paragraph("STERILIZATION", label_style), Paragraph(sterilization, body_style)],
        ]

        content_table = Table(
            content_rows,
            colWidths=[2.6*cm, doc.width - 2.6*cm]
        )
        content_table.setStyle(TableStyle([
            ("VALIGN",        (0,0), (-1,-1), "TOP"),
            ("TOPPADDING",    (0,0), (-1,-1), 3),
            ("BOTTOMPADDING", (0,0), (-1,-1), 3),
            ("LEFTPADDING",   (1,0), (1,-1), 6),
            ("RIGHTPADDING",  (0,0), (-1,-1), 4),
            ("LINEBELOW", (0,1), (-1,1), 0.5, GREY_LINE),
        ]))

        # Image cell
        if img_path:
            try:
                img_obj = RLImage(img_path, width=4.5*cm, height=3.2*cm, kind="proportional")
                img_cell = img_obj
            except Exception as e:
                print(f"  [img render fail] {e}")
                img_cell = Paragraph("<i>[image unavailable]</i>", body_style)
        else:
            img_cell = Paragraph("<i>Image not available</i>", body_style)

        main_cols = Table(
            [[content_table, img_cell]],
            colWidths=[doc.width - 5*cm, 5*cm]
        )
        main_cols.setStyle(TableStyle([
            ("VALIGN",        (0,0), (-1,-1), "TOP"),
            ("LEFTPADDING",   (0,0), (-1,-1), 0),
            ("RIGHTPADDING",  (0,0), (-1,-1), 0),
            ("TOPPADDING",    (0,0), (-1,-1), 0),
            ("BOTTOMPADDING", (0,0), (-1,-1), 0),
        ]))

        card_data = [
            [header_table],
            [HRFlowable(width="100%", thickness=1, color=TEAL)],
            [main_cols],
        ]
        card_table = Table(card_data, colWidths=[doc.width])
        bg_color = LIGHT_BG if num % 2 == 0 else WHITE
        card_table.setStyle(TableStyle([
            ("BACKGROUND",    (0,0), (-1,-1), bg_color),
            ("BOX",           (0,0), (-1,-1), 1, GREY_LINE),
            ("ROUNDEDCORNERS",(0,0), (-1,-1), [6,6,6,6]),
            ("TOPPADDING",    (0,0), (-1,-1), 6),
            ("BOTTOMPADDING", (0,0), (-1,-1), 8),
            ("LEFTPADDING",   (0,0), (-1,-1), 8),
            ("RIGHTPADDING",  (0,0), (-1,-1), 8),
        ]))

        story.append(KeepTogether([card_table, Spacer(1, 0.3*cm)]))

    # ── Back page ───────────────────────────────────────────────────────────────
    story.append(PageBreak())
    back_data = [
        [Paragraph("STERILIZATION QUICK REFERENCE", ParagraphStyle("bk",
            parent=cat_style, fontSize=14, textColor=WHITE))],
        [Spacer(1, 0.2*cm)],
    ]
    back_table = Table(back_data, colWidths=[doc.width])
    back_table.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), NAVY),
        ("TOPPADDING",    (0,0), (-1,-1), 12),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING",   (0,0), (-1,-1), 14),
        ("RIGHTPADDING",  (0,0), (-1,-1), 14),
    ]))
    story.append(back_table)
    story.append(Spacer(1, 0.3*cm))

    quick_ref = [
        ["Method", "Temperature / Conditions", "Duration", "Suitable For"],
        ["Steam Autoclave\n(Pre-vacuum)", "134 °C / 3 bar", "3–4 min", "Metal instruments, drapes, dressings"],
        ["Steam Autoclave\n(Gravity)", "121 °C / 15 psi", "15–30 min", "Metal instruments, rubber goods"],
        ["Hot-Air Oven", "160 °C / 170 °C", "60 min / 40 min", "Dry metal, glassware, oils, powders"],
        ["Boiling Water", "100 °C", "20 min", "Disinfection only — NOT sterile"],
        ["2% Glutaraldehyde", "Room temperature", "20–30 min (HLD)\n10 hours (sterilization)", "Heat-sensitive equipment, endoscopes"],
        ["Hydrogen Peroxide\nPlasma (STERRAD)", "~55 °C", "54–75 min cycle", "Delicate optics, electronics, cameras"],
        ["70% Isopropyl\nAlcohol Wipe", "Room temperature", "30 sec contact", "Surfaces only — NOT for lumened devices"],
        ["1% Sodium\nHypochlorite", "Room temperature", "10 min contact", "Surface disinfection, spill management"],
    ]
    qr_table = Table(
        quick_ref,
        colWidths=[4*cm, 4.5*cm, 3.5*cm, doc.width - 12*cm]
    )
    qr_table.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), TEAL),
        ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
        ("FONTNAME",      (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",      (0,0), (-1,-1), 8),
        ("FONTNAME",      (0,1), (-1,-1), "Helvetica"),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [WHITE, ROW_ALT]),
        ("GRID",          (0,0), (-1,-1), 0.5, GREY_LINE),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
    ]))
    story.append(qr_table)
    story.append(Spacer(1, 0.5*cm))
    story.append(Paragraph(
        "Note: Always follow your institution's Infection Prevention and Control (IPC) policy. "
        "When in doubt, use the highest level of sterilization available. "
        "Instruments marked for single use must NEVER be re-sterilized.",
        body_style
    ))
    story.append(Spacer(1, 1*cm))
    story.append(Paragraph("© 2026 Surgical Instruments Reference Guide — For Educational Use", footer_style))

    # ── Build ───────────────────────────────────────────────────────────────────
    doc.build(story)
    print(f"\n✅ PDF generated: {OUTPUT_PATH}")

if __name__ == "__main__":
    build_pdf()
Running Command

cd /home/daytona/workspace/surgical-instruments && python3 generate_pdf.py 2>&1

Running Command

python3 -c " import urllib.request, os # Test correct Wikimedia Commons URLs ur…

Running Command

ls -lh /home/daytona/workspace/surgical-instruments/Surgical_Instruments_Referen…

attachment
attachment

Make pdf all this instrument with their image there identification and there use with there sterilization

New Chat Jul 3, 2026 Jaundice and Ascites Correction User Equipment and instruments 1 Computer with internet and printer 2 Spotlight (Shadowless ceiling fitted) 3 Needle holding Forceps(big-medium-small) 4 Dressing drums of Assorted size 5 Intravenous Stand 6 X-ray View Box(double) 7 Cheatle's Forceps 8 Mosquito forceps 9 Scissors straight (Tailor) 10 Scissors curved of different sizes 11 Stitch removal Scissors 12 Dissection forceps 13 Sinus Forceps 14 Probes-Assorted size 15 Pointed scissors 16 Gastric and Intestinal clamps (occlusive and crushing) 17 Abdominal Retractors 18 Tissue Forceps 19 Babcock's Forceps 20 Kocher's Forceps 21 Urethral Dilators 22 Rubber catheters of Assorted size 23 Metal Catheters 24 Suturing Needle (straight or curved) of Assorted size 25 Surgical Thread 26 Sponge holding forceps 27 Right Angle cholecystectomy Forceps 28 Stone holding forceps 29 Proctoscope with or without illuminator 30 Bougies (Megars) 31 Allies Forceps small 32 Allies Forceps big 33 Pile holding forceps 34 Artery Forceps small 35 Artery Forceps big 36 Artery Forceps Medium 37 Sigmoidoscope Rigid or flexible 38 Barron Pile's Gun 39 Laryngoscope Pediatric or Adult 40 Ambu Bag 41 Suction machine Electrical or Manual 42 Emergency light A 43 Skin grafting knife with handle 44 Surgical blades of different size 45 BP Handle of different size 46 Self-Retaining Retractor 47 Bone Drill Machine 48 Bone cutter 49 Giggly Saw 50 Scoop 51 Periosteum elevator 52 Maggler Forceps 53 Endotracheal Tubes of different sizes 54 High Pressure Autoclave 55 Fumigator 56 Refrigerator 57 Nitrous Oxide Cylinder 58 Hydrolic Operation Table 59 Anaesthesia Trolley or Boyle's Apparatus 60 Gabriel Syringe 61 Stretcher with trolley 62 Non mercury sphygmoman meter 63 Doyen's retractor 64 Green Armitage forceps 65 Sterilizer 66 Sim's speculum 67 Anterior vaginal wall retractor 68 Cusco's speculum 69 Uterine sound 70 Anterior Vaginal Wall retractor Make pdf all this instrument and leave some space to insert image by my self with their identification and there use with there sterilization

Running Command

mkdir -p /home/daytona/workspace/surgical-instruments && python3 -c "from report…

New Chat Jul 3, 2026 Jaundice and Ascites Correction User Equipment and instruments 1 Computer with internet and printer 2 Spotlight (Shadowless ceiling fitted) 3 Needle holding Forceps(big-medium-small) 4 Dressing drums of Assorted size 5 Intravenous Stand 6 X-ray View Box(double) 7 Cheatle's Forceps 8 Mosquito forceps 9 Scissors straight (Tailor) 10 Scissors curved of different sizes 11 Stitch removal Scissors 12 Dissection forceps 13 Sinus Forceps 14 Probes-Assorted size 15 Pointed scissors 16 Gastric and Intestinal clamps (occlusive and crushing) 17 Abdominal Retractors 18 Tissue Forceps 19 Babcock's Forceps 20 Kocher's Forceps 21 Urethral Dilators 22 Rubber catheters of Assorted size 23 Metal Catheters 24 Suturing Needle (straight or curved) of Assorted size 25 Surgical Thread 26 Sponge holding forceps 27 Right Angle cholecystectomy Forceps 28 Stone holding forceps 29 Proctoscope with or without illuminator 30 Bougies (Megars) 31 Allies Forceps small 32 Allies Forceps big 33 Pile holding forceps 34 Artery Forceps small 35 Artery Forceps big 36 Artery Forceps Medium 37 Sigmoidoscope Rigid or flexible 38 Barron Pile's Gun 39 Laryngoscope Pediatric or Adult 40 Ambu Bag 41 Suction machine Electrical or Manual 42 Emergency light A 43 Skin grafting knife with handle 44 Surgical blades of different size 45 BP Handle of different size 46 Self-Retaining Retractor 47 Bone Drill Machine 48 Bone cutter 49 Giggly Saw 50 Scoop 51 Periosteum elevator 52 Maggler Forceps 53 Endotracheal Tubes of different sizes 54 High Pressure Autoclave 55 Fumigator 56 Refrigerator 57 Nitrous Oxide Cylinder 58 Hydrolic Operation Table 59 Anaesthesia Trolley or Boyle's Apparatus 60 Gabriel Syringe 61 Stretcher with trolley 62 Non mercury sphygmoman meter 63 Doyen's retractor 64 Green Armitage forceps 65 Sterilizer 66 Sim's speculum 67 Anterior vaginal wall retractor 68 Cusco's speculum 69 Uterine sound 70 Anterior Vaginal Wall retractor Make pdf all this instrument with their identification and there use with there sterilization

New Chat Jul 3, 2026 Jaundice and Ascites Correction User Equipment and instruments 1 Computer with internet and printer 2 Spotlight (Shadowless ceiling fitted) 3 Needle holding Forceps(big-medium-small) 4 Dressing drums of Assorted size 5 Intravenous Stand 6 X-ray View Box(double) 7 Cheatle's Forceps 8 Mosquito forceps 9 Scissors straight (Tailor) 10 Scissors curved of different sizes 11 Stitch removal Scissors 12 Dissection forceps 13 Sinus Forceps 14 Probes-Assorted size 15 Pointed scissors 16 Gastric and Intestinal clamps (occlusive and crushing) 17 Abdominal Retractors 18 Tissue Forceps 19 Babcock's Forceps 20 Kocher's Forceps 21 Urethral Dilators 22 Rubber catheters of Assorted size 23 Metal Catheters 24 Suturing Needle (straight or curved) of Assorted size 25 Surgical Thread 26 Sponge holding forceps 27 Right Angle cholecystectomy Forceps 28 Stone holding forceps 29 Proctoscope with or without illuminator 30 Bougies (Megars) 31 Allies Forceps small 32 Allies Forceps big 33 Pile holding forceps 34 Artery Forceps small 35 Artery Forceps big 36 Artery Forceps Medium 37 Sigmoidoscope Rigid or flexible 38 Barron Pile's Gun 39 Laryngoscope Pediatric or Adult 40 Ambu Bag 41 Suction machine Electrical or Manual 42 Emergency light A 43 Skin grafting knife with handle 44 Surgical blades of different size 45 BP Handle of different size 46 Self-Retaining Retractor 47 Bone Drill Machine 48 Bone cutter 49 Giggly Saw 50 Scoop 51 Periosteum elevator 52 Maggler Forceps 53 Endotracheal Tubes of different sizes 54 High Pressure Autoclave 55 Fumigator 56 Refrigerator 57 Nitrous Oxide Cylinder 58 Hydrolic Operation Table 59 Anaesthesia Trolley or Boyle's Apparatus 60 Gabriel Syringe 61 Stretcher with trolley 62 Non mercury sphygmoman meter 63 Doyen's retractor 64 Green Armitage forceps 65 Sterilizer 66 Sim's speculum 67 Anterior vaginal wall retractor 68 Cusco's speculum 69 Uterine sound 70 Anterior Vaginal Wall retractor all this instrument with their imaidentification and there use with there sterilization

New Chat Jul 3, 2026 Jaundice and Ascites Correction User Equipment and instruments 1 Computer with internet and printer 2 Spotlight (Shadowless ceiling fitted) 3 Needle holding Forceps(big-medium-small) 4 Dressing drums of Assorted size 5 Intravenous Stand 6 X-ray View Box(double) 7 Cheatle's Forceps 8 Mosquito forceps 9 Scissors straight (Tailor) 10 Scissors curved of different sizes 11 Stitch removal Scissors 12 Dissection forceps 13 Sinus Forceps 14 Probes-Assorted size 15 Pointed scissors 16 Gastric and Intestinal clamps (occlusive and crushing) 17 Abdominal Retractors 18 Tissue Forceps 19 Babcock's Forceps 20 Kocher's Forceps 21 Urethral Dilators 22 Rubber catheters of Assorted size 23 Metal Catheters 24 Suturing Needle (straight or curved) of Assorted size 25 Surgical Thread 26 Sponge holding forceps 27 Right Angle cholecystectomy Forceps 28 Stone holding forceps 29 Proctoscope with or without illuminator 30 Bougies (Megars) 31 Allies Forceps small 32 Allies Forceps big 33 Pile holding forceps 34 Artery Forceps small 35 Artery Forceps big 36 Artery Forceps Medium 37 Sigmoidoscope Rigid or flexible 38 Barron Pile's Gun 39 Laryngoscope Pediatric or Adult 40 Ambu Bag 41 Suction machine Electrical or Manual 42 Emergency light A 43 Skin grafting knife with handle 44 Surgical blades of different size 45 BP Handle of different size 46 Self-Retaining Retractor 47 Bone Drill Machine 48 Bone cutter 49 Giggly Saw 50 Scoop 51 Periosteum elevator 52 Maggler Forceps 53 Endotracheal Tubes of different sizes 54 High Pressure Autoclave 55 Fumigator 56 Refrigerator 57 Nitrous Oxide Cylinder 58 Hydrolic Operation Table 59 Anaesthesia Trolley or Boyle's Apparatus 60 Gabriel Syringe 61 Stretcher with trolley 62 Non mercury sphygmoman meter 63 Doyen's retractor 64 Green Armitage forceps 65 Sterilizer 66 Sim's speculum 67 Anterior vaginal wall retractor 68 Cusco's speculum 69 Uterine sound 70 Anterior Vaginal Wall retractor all this instrument with their image there identification and there use with there sterilization

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