PDF to Markdown for Cursor: Feed Docs to Your AI Coder
Cursor is wonderful when it knows the library. It's embarrassing when it doesn't: inventing methods, hallucinating signatures, citing versions that never existed. The fix is to give it the docs. The fix that actually works is to give it the docs as Markdown, dropped in the workspace where Cursor's context engine will pick them up.
The "feed Cursor your docs" workflow
Step one: take the PDF documentation for whatever library Cursor is hallucinating against, convert it to Markdown, save it as docs/library-name.md at the root of your repo. Cursor's indexer treats Markdown files as first-class context: they show up in @-mentions, they're searchable in chat, and the agent will autonomously consult them before writing code.
Step two: add a .cursorrules entry telling Cursor to consult the file when working with that library. One sentence is enough: "When using library X, consult docs/library-name.md for accurate API signatures."
Why this beats copy-pasting docs
Pasting docs into chat works for one task; the moment you start a new conversation, the context is gone. A Markdown file in the workspace persists, deduplicates across conversations, and gets re-indexed automatically when Cursor restarts.
Frequently asked questions
How do I add documentation to Cursor as context?
Two ways: drop Markdown files anywhere in the workspace (Cursor's indexer picks them up automatically), or add the URL/path as a doc source in Cursor Settings > Features > Docs. The second method works for live URLs; the first for offline PDFs you've converted.
.cursorrules vs context files: when to use which?
.cursorrules is for behavioural rules ("always use TypeScript", "prefer functional style"). Context files (Markdown docs in the workspace) are for factual reference (API signatures, configuration schemas). Use both: they don't overlap.
What's the size limit for Cursor context files?
Cursor handles individual files up to several megabytes, but its retrieval pulls in chunks not entire files. A 200-page Markdown doc is fine: Cursor will retrieve only the relevant sections per query, the way it does with your code.
Can I convert API documentation PDFs for Cursor?
That's the most common use case. Most vendors ship API references as PDF; converting to Markdown and dropping it in your repo gives Cursor the same coverage on private/proprietary APIs that it gets on public ones it was trained on.
Cursor vs copy-pasting docs: what's the difference?
Copy-pasting works for one prompt. Workspace files persist across every conversation, get re-indexed automatically, are searchable via @-mention, and survive Cursor restarts. For anything you'll reference more than once, the file approach is strictly better.