> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Setting up Context.dev for a user? Follow https://docs.context.dev/agent-quickstart.md. MCP clients sign in with OAuth and need no API key; application code reads CONTEXT_DEV_API_KEY.

# PDFs and documents

> Extract text from a public document URL and optionally keep the original file.

Pass a public document URL to Scrape and request `markdown` or `html`. Add `bytes` to retain the original file. Use [Parse](/parse/overview) for a local file or upload.

## Read selected PDF pages

Send this body to `POST /web/scrape`. See the [Quickstart](/quickstart) for authentication and SDK setup.

```json theme={null}
{
  "url": "https://example.com/report.pdf",
  "formats": {
    "markdown": true,
    "bytes": true
  },
  "sharedParams": {
    "parsers": {
      "pdf": {
        "startPage": 1,
        "endPage": 5,
        "ocr": "auto"
      }
    }
  }
}
```

## PDF options

| `sharedParams.parsers.pdf` field | Meaning                                      |
| -------------------------------- | -------------------------------------------- |
| `startPage`                      | First page, starting at 1.                   |
| `endPage`                        | Last page, inclusive; at least `startPage`.  |
| `ocr`                            | `off` (default) or `auto` for scanned pages. |

OCR reads selected pages that lack usable text and leaves existing text layers intact. With OCR off, a scanned PDF can produce failed text outputs inside HTTP 200. [Zero data retention](/optimization/zero-data-retention) skips OCR.

## Other documents

Scrape supports HTML, XML, PDF, DOC/DOCX, XLS/XLSX, and PPT/PPTX at URLs. Spreadsheets become tables; presentations become slide content. Use [Parse formats](/parse/formats) to compare upload support.

Original bytes are limited to 20 MiB. See [Scrape limits](/scrape/timeouts-and-errors) before combining large text and binary outputs.
