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

# PdfContent

> PDF document content type for prompt messages with file metadata.

# PdfContent

PDF document content with file metadata for multi-modal LLM messages.

## Import

```typescript theme={null}
import type { PdfContent } from '@adaline/api';
```

## Type Definition

```typescript theme={null}
interface PdfContent {
  modality: 'pdf';
  value: PdfContentValue;
  file: PdfContentFile;
}

type PdfContentValue = Base64PdfContentValue | UrlPdfContentValue;

interface UrlPdfContentValue {
  type: 'url';
  url: string;
}

interface Base64PdfContentValue {
  type: 'base64';
  base64: string;
}

interface PdfContentFile {
  name: string;
  id: string;
  size?: number | null;
}
```

## Fields

**modality** `string` *required*

Must be `"pdf"`.

**value** `PdfContentValue` *required*

PDF data — either a URL reference or base64-encoded content.

**file** `PdfContentFile` *required*

File metadata with `name`, `id`, and optional `size` in bytes.

***

## Example

```typescript theme={null}
import type { PdfContent, PromptMessage } from '@adaline/api';

const pdf: PdfContent = {
  modality: 'pdf',
  value: {
    type: 'url',
    url: 'https://example.com/report.pdf'
  },
  file: {
    name: 'Q4_Report.pdf',
    id: 'file_abc123',
    size: 1024000
  }
};

const message: PromptMessage = {
  role: 'user',
  content: [
    { modality: 'text', value: 'Summarize this document' },
    pdf
  ]
};
```

**JSON**:

```json theme={null}
{
  "modality": "pdf",
  "value": {
    "type": "url",
    "url": "https://example.com/report.pdf"
  },
  "file": {
    "name": "Q4_Report.pdf",
    "id": "file_abc123",
    "size": 1024000
  }
}
```

***

## Related

* [MessageContent](https://www.adaline.ai/docs/reference/sdk/v2/typescript/types/MessageContent.md) — union type that includes `PdfContent`
* [PromptMessage](https://www.adaline.ai/docs/reference/sdk/v2/typescript/types/PromptMessage.md) — uses `MessageContent[]` as its `content` field


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.