How to Search a PDF From Your Editor
Every integration has one: the partner spec, the compliance manual, the vendor's 80-page PDF that governs what your code must do. Your questions about it arrive mid-function — and the answer ritual is alt-tab, scroll, squint, Ctrl+F, lose your place twice.
With Apdf connected to Claude Code or Cursor over MCP, the spec becomes something you ask from the editor — and the answers come back with the exact line and page number, ready to paste into a code comment.
Connect your editor to Apdf
In Claude Code it's one command; Cursor and other MCP clients take the same endpoint in their MCP settings:
claude mcp add --transport http apdf https://apdf.io/mcp/main
The spec just needs a reachable URL — your team drive, object storage, or a private Apdf document.
Ask mid-function
https://files.northlight.example/specs/paylane-spec.pdf
Under the answer, search-pdf-content returned the
receipts — the exact line, with its page:
{
"search_text": "backoff",
"results_total": 1,
"results_pages": 1,
"results": [
{
"page": "3",
"matched_line": "Retries: 5 attempts with exponential backoff starting at 30 seconds.",
"exact_word": "backoff"
}
]
}
Go regex when the question is a pattern
The search accepts regular expressions — which turns “list every error code the spec defines” into one call:
{
"search_text": "ERR-\\d+",
"results_total": 3,
"results_pages": 1,
"results": [
{
"page": "4",
"matched_line": "Errors use stable codes: ERR-1401 expired token, ERR-2201 duplicate idempotency key,",
"exact_word": "ERR-1401"
},
{
"page": "4",
"matched_line": "Errors use stable codes: ERR-1401 expired token, ERR-2201 duplicate idempotency key,",
"exact_word": "ERR-2201"
},
{
"page": "4",
"matched_line": "ERR-3305 payout account frozen. Codes never change meaning between versions.",
"exact_word": "ERR-3305"
}
]
}
read-pdf-content returns whole
pages for context, and for scanned specs the
search-pdf-content-with-ocr variant runs an OCR pass first —
the OCR tutorial
covers it.
Where to go from here
The same connection carries every PDF operation — and the links, events and signatures behind them.
Related tutorials
Building a "Search Inside PDF" Feature for Your Web App
This tutorial shows how to build a PDF search feature using Python and the Apdf Search API. Find specific terms, get page numbers and context lines, and optionally use regex patterns for advanced matching. Includes a Flask web interface example.
How to Convert Word and PowerPoint Files to PDF by Asking Claude
Paste the links, get PDFs back. Connect Claude to Apdf over MCP and convert decks and documents conversationally — then let the agent store the PDF as a tracked document and mint a personal link for the client.
Extract the Answers from Filled PDF Forms with an AI Agent
Fillable PDFs already store every answer in a named field — no zones to draw, no parser to train. Hand an agent connected to Apdf a stack of returned applications and it reads each form's fields into one CSV, flags the applicant who skipped a required answer, and catches the copy that came back flattened.
Your code made the PDF.
Then it went dark.
Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.
API · Webhook · MCP