generate-document-pdf
Generate a complete PDF from chapter image folders using four modes: original images, Tesseract OCR text, combined image+text, or LLaVA vision extraction for complex layouts.
Instructions
Generates a complete PDF from chapter image folders. Mode 'images' (default): inserts original images full-page, faithful to the original layout. Mode 'text': Tesseract OCR text only. Mode 'images+text': each original image followed by its Tesseract OCR text. Mode 'vision': LLaVA (Ollama local) extracts text -- best quality for complex layouts, requires Ollama running with llava model.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "generate-document-pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'images' (default): original images full-page, faithful rendering. 'text': Tesseract OCR text only. 'images+text': image + Tesseract OCR text per page. 'vision': LLaVA vision text extraction via Ollama (local, requires ollama pull llava). | |
| chapters | No | Chapters to include (default: 1-9) | |
| language | No | Tesseract OCR language code (default: env OCR_LANGUAGE or 'fra'). Ignored in vision mode. | |
| outputFilename | No | Output PDF filename (default: 'document-complet.pdf') |