readfetch_pdf
Extracts text and metadata from PDF files supplied by URL or base64 bytes, returning per-page text and a combined Markdown body for downstream processing.
Instructions
Extract text from a PDF (%PDF- magic, not Content-Type): send exactly one of url (downloaded through egress) or content_base64 (inline bytes, ≤ 20 MB). Returns per-page text in pages, one concatenated markdown body, plus title and metadata; $0.005 per document, not per page. max_pages limits how many pages are extracted (default 50, max 200); a document above the cap or above 200 pages returns 413 and is not billed. Image-only/scanned PDFs may return empty text with billed: false and a hint. Use readfetch_text or readfetch_scrape for HTML pages; use readfetch_batch for many HTML URLs, not PDFs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public PDF URL; fetched through egress (≤ 20 MB). Mutually exclusive with content_base64. | |
| filename | No | Optional label when using content_base64 (default upload.pdf); ignored for url-only requests. | |
| max_pages | No | Extract at most this many pages. Default 50; raise up to 200 when the document is longer. Over cap → 413, unbilled. | |
| content_base64 | No | Base64-encoded PDF bytes (≤ 20 MB). Mutually exclusive with url; pair with filename when the label matters. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| pages | No | ||
| title | No | ||
| billed | No | ||
| source | No | ||
| status | No | ||
| markdown | No | ||
| metadata | No | ||
| page_count | No | ||
| content_sha256 | No |