Read PDF text
pdf_readReads text from PDFs with a text layer, page by page, reconstructing paragraphs and marking headings. Returns 1-based page numbers for paging.
Instructions
Read the text of a PDF, page by page, with the page layout reconstructed into paragraphs.
Returns 1-based page numbers with their text. Headings are marked with a leading "# " so the structure of the page is visible. Pages are paged: pass from/to to move through the document.
This only works on PDFs that carry a text layer. If the PDF is a scan (pdf_info reports scanned: true), there is no text to extract and this tool refuses — render the pages with pdf_render_page and read them as images instead.
For a scanned PDF you can still use pdf_outline to learn which page a chapter starts on, then pass that page to pdf_render_page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last page to read, inclusive. | |
| from | No | First page to read, 1-based (default 1). | |
| mode | No | paragraphs (default) merges visual lines into paragraphs; lines keeps one entry per visual line (useful for tables). | |
| path | Yes | Path to the PDF. | |
| max_chars | No | Character budget for this call (default 9000). |