pdf_analyze
Detect whether a PDF contains a text layer or is scanned, then return layout and character statistics to guide OCR or extraction.
Instructions
Detect whether a PDF has a text layer (digital) or is scanned, with layout stats.
Return Format
A dict with keys:
success: bool
pages: int
has_text_layer: bool - true when average chars per page >= 80
scanned: bool - low text + images present
chars_per_page: float
total_chars: int
image_count: int
layout_hint: str - digital | scanned | empty
per_page: list of {page, chars, images}
Examples
await pdf_analyze(path="scan.pdf") {"success": true, "pages": 5, "has_text_layer": false, "scanned": true, "chars_per_page": 12.4, "image_count": 5, "layout_hint": "scanned", "per_page": [...]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the PDF file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Human-readable summary | |
| success | No | Whether the operation succeeded |