> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timbal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF

> AI agents can read and analyze PDF documents for content extraction and processing

Agents automatically handle PDF files when included in prompts. First validate your PDF file with Timbal's `File` type, then pass it alongside text in a list:

```python theme={"dark"}
from timbal import Agent
from timbal.types.file import File

agent = Agent(
    name="DocumentAgent",
    model="openai/gpt-4.1", # Vision-capable model
    system_prompt="Analyze PDF documents and extract key information."
)

# Validate PDF file and analyze
pdf_file = File.validate("path/to/document.pdf")
result = await agent(
    prompt=["Summarize this document and highlight the main points", pdf_file]
).collect()

print(result.output.collect_text())
```

<Warning>
  PDFs are converted to images, so vision-capable models are required. Check the [Model Reference](/models/overview) for models with vision support.
</Warning>

## Key Features

* **Automatic Processing**: PDF files are automatically converted to images and parsed for text content
* **Document Analysis**: Extract text, structure, and insights from PDF documents
* **File Support**: Works with local files, URLs, and base64 data
