Make Cursor read PDFs
Cursor's agent reads code, not PDFs. But it can run terminal commands — so give it one: a zero-install CLI that converts any PDF (including scans, complex tables, and multi-column layouts) to clean markdown with a GPU vision-language OCR model.
$ npx pdftomarkdown document.pdf -o document.md No install, no signup — works immediately with Node 18+.
One-off: just tell the agent
Mention the command once in your prompt and the agent takes it from there:
> run npx pdftomarkdown on spec.pdf and implement the endpoints it describes Permanent: add a project rule
Save this as .cursor/rules/read-pdfs.mdc and Cursor handles PDFs in every session (a plain .cursorrules entry works too):
---
description: How to read PDF files
alwaysApply: true
---
You cannot open PDF files directly. To read any PDF (local file or
https URL), convert it to markdown first by running this in the terminal:
npx pdftomarkdown document.pdf -o document.md
then read the markdown file. GPU OCR takes 10-30 seconds per page and
cold starts can add a minute - always wait, never cancel the command.
If the output is truncated to page 1, the free demo tier is active;
ask the user to set PDFTOMARKDOWN_API_KEY for full documents. Free API key for full documents
Without a key, the demo tier converts page 1 of any PDF — enough to try it. A free Developer key (100 pages/month, full multi-page, no watermark) takes 30 seconds:
Get a free API key with GitHub →
export PDFTOMARKDOWN_API_KEY=your_key_here The CLI picks the key up automatically from the environment.
Links
CLI guide · API docs · npm package · Using Claude Code instead? · Using Codex?