Claude citations give you the page, not the box¶
Claude tells you the page. It does not tell you where on it.
On our invoice test, 94.9% of the citation boxes ReadAnyDoc returned showed the cited value inside them, against
87.9% for
Reducto (20 invoices, our run). That is a box per field; Claude's own citations stop at the page.
If you already extract fields with Claude and want to highlight each one on the page, this is what the API gives you, the gap, and two ways to close it.
What Claude's citations return for a PDF¶
From Anthropic's citations documentation (read 4 December 2026):
| Location | page_location: start_page_number (from 1) and end_page_number (exclusive), plus cited_text |
| Coordinates | none |
| Scanned PDFs | not citable: Claude "can't cite images", so a scan with no extractable text gets no citations |
| With structured outputs | not allowed together: citations and structured outputs are incompatible |
So you get "page 5" and the sentence. For a review screen you still need the rectangle, and for JSON output you have to choose between a schema and citations.
1. Turn a citation into a box (PDFs with a text layer)¶
You have the page and the quoted text. Search that page for it:
import pymupdf # pip install pymupdf
def box_for(pdf_path, page_number, cited_text):
"""Boxes (x0, y0, x1, y1, in PDF points) where cited_text is printed on a page (pages from 1)."""
page = pymupdf.open(pdf_path)[page_number - 1]
hits = page.search_for(cited_text)
if not hits: # the quote may wrap lines or differ in spacing: try its longest words
words = sorted(cited_text.split(), key=len, reverse=True)[:3]
hits = [r for w in words for r in page.search_for(w)]
return [(round(r.x0, 1), round(r.y0, 1), round(r.x1, 1), round(r.y1, 1)) for r in hits]
On a test report, with a citation for page 2:
box_for("report.pdf", 2, "1,119.00")
# [(250.0, 220.3, 285.0, 232.7)]
box_for("report.pdf", 2, "not on the page")
# [] -> no box: do not show a highlight you cannot back
Pass citation.start_page_number and citation.cited_text straight in. Three things to handle:
- Several hits. A total printed three times gives three boxes. Keep the one nearest the label, or show all.
- The quote is a sentence, your field is a value. Search for the value inside the cited page instead of the whole sentence.
- An empty list. Treat it as "no source found" and send the field to review.
2. Scanned pages¶
There is no text to search and Claude returns no citation. You need word boxes from OCR (Tesseract, Textract,
Azure
and Google all return them), then match the value against the words. See
show where a value came from on the page for the matching.
3. Get the box with the value, with a schema¶
ReadAnyDoc (open source, Apache-2.0) runs on your own Claude key and returns a typed result and a box for every field in one call, scans included:
import readanydoc
from pydantic import BaseModel
class Invoice(BaseModel):
invoice_number: str
total: float
out = readanydoc.extract("invoice.pdf", schema=Invoice)
for c in out.citations["total"]:
print(c.content, c.confidence, c.bbox)
# £1,575.00 high BoundingBox(page=1, left=0.71, top=0.83, width=0.12, height=0.02)
bbox is in fractions of the page; page counts from 1.
How often the box is right¶
Share of boxes that contain the value, checked against the PDF's own words (digital pages, our run):
| Test set | ReadAnyDoc | Reducto |
|---|---|---|
| Invoices | 94.9% | 87.9% |
| Credit agreements | 85.5% | 78.3% |
| Research papers | 66.0% | 40.2% |
| 10-Q and 10-K filings | 36.6% | 14.9% |
| Sports results | 89.8% | 96.4% |
Where this loses¶
- Dense filings. On 10-Q and 10-K filings only 36.6% of ReadAnyDoc's boxes show the value. Better than Reducto's 14.9%, and still not something to trust without a check.
- Coverage. Reducto returns a box for 100% of values; ReadAnyDoc for 89.5% on invoices and 70.2% on filings.
- Speed. About 20 to 50 seconds a page; Reducto about 4. Claude's own citations add almost nothing to a call.
- If page-level is enough for you, Claude's citations are simpler and you need nothing else.
Questions¶
Can Claude return bounding-box coordinates in a citation? No. For PDFs the citation is a page range and the quoted text.
Can I use citations and a JSON schema in the same request? Not with structured outputs; Anthropic documents them as incompatible. Either ask for cited lines and parse them yourself, or extract with a schema and locate each value afterwards (step 1).
Do citations work on scanned PDFs? No. A scan with no extractable text cannot be cited.