# PDF Parser

## PDF Document Processing Guide

Document Parser API supports extraction of text content from PDF files.

### Endpoint

`POST /documents/parse`

### PDF-Specific Configuration

```json
{
    "url": "string",          // URL of the PDF document
    "type": "pdf",           // Specify "pdf" for PDF processing
    "output": "plain|markdown",
    "webhook": "string"      // Optional webhook URL
}
```

### Supported PDF Features

* Single and multi-page PDFs
* Text-based PDFs
* Scanned PDFs (using OCR)
* Password-protected PDFs (not supported)
* Maximum file size: 50MB

### Example Request

```bash
curl --location 'https://api.yetanotherapi.com/documents/parse' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/document.pdf",
    "type": "pdf",
    "output": "markdown"
}'
```

### Response Format

Each page's content is separated by a page break marker:

```json
{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Page 1 content\n\n=== Page Break ===\n\nPage 2 content"
}
```

### PDF-Specific Limitations

1. Forms and fillable fields are processed as static text
2. Complex layouts may affect text ordering
3. Headers and footers are included in the extracted text
4. Images within PDFs are not processed
5. PDF versions supported: 1.0 to 2.0


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yetanotherapi.com/document-parser/pdf-parser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
