Convert PDF to JSON
pdf_to_jsonConvert a PDF to JSON with metadata, page count, and each page's text. Use when you need page structure or a JSON file for other tools.
Instructions
Convert a local PDF into structured JSON: document metadata (title, author...), page count, and the text of each page. Use read_file for a quick plain-text read; use this when you need page structure, metadata, or a JSON file other tools can consume (e.g. json_query).
Args:
path (string): The PDF file.
output_path (string): Optional .json destination. If set, the full JSON is written there and only a summary is returned — best for large PDFs.
Returns { source, total_pages, metadata, pages: [{ page, text }] }.
Example: { "path": "/papers/attention.pdf", "output_path": "/papers/attention.json" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | PDF file path | |
| output_path | No | Optional .json file to write the result to |