find_text
Locate a known text string on a plan sheet and get its center coordinates to seed one-click area tracing. Supports case-insensitive substring matching and optional region restriction.
Instructions
LOCATE a known string on a sheet — the complement to read_sheet_text (which returns what a region SAYS; this finds WHERE a string you already know sits). Case-insensitive substring match against each pdf.js text run, so a room label split across runs ("OFFICE" then "134" as separate items) needs a find_text call per fragment, or read_sheet_text over a region to see the whole thing joined. Every hit's center feeds straight into one_click as the seed — the locate-then-trace workflow: find_text the room number, one_click at (or just past) its center. Optionally restrict to a region {x0, y0, x1, y1}; results cap at limit (default 200), with count/truncated telling you exactly how much a tighter region or higher limit would recover. Coordinates are image px at render scale 2.0: PDF pt × 2, origin top-left, y down (the browser canvas's native space). Sheet payloads carry dims in both px and pt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Text to find — a room number ('134'), a label fragment ('RECEPTION'), a schedule tag ('CPT-1') | |
| limit | No | Max hits returned | |
| sheet | Yes | ||
| region | No | Rect in image px (origin top-left, y down); omit for the full sheet |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | ||
| hits | Yes | ||
| count | Yes | Total matches before the limit cap | |
| sheet | Yes | ||
| truncated | Yes | true = count exceeds hits.length; narrow the region or raise limit |