---
title: "Extend your DOC export with Headers & Footers"
description: "Learn how to extend your DOC exports with custom Headers & Footers using the Export DOC extension."
canonical_url: "https://tiptap.dev/docs/conversion/export/doc/headers-footers"
---

# Extend your DOC export with Headers & Footers

Learn how to extend your DOC exports with custom Headers & Footers using the Export DOC extension.

- **1. Activate trial or subscribe**

  Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Start plan](https://cloud.tiptap.dev/v2/billing) in your account.
- **2. Install from private registry**

  To install this frontend extension, authenticate to Tiptap's private npm registry by following the [setup guide](https://tiptap.dev/docs/guides/pro-extensions.md).

> **Consider using DOCX instead:**
>
> The DOC format is a legacy format from Microsoft Word 97-2003. For modern use, we recommend exporting to [DOCX](https://tiptap.dev/docs/conversion/export/docx/headers-footers.md) instead. Use DOC only when compatibility with older systems requires it.

The `@tiptap-pro/extension-export-doc` extension includes built-in support for customizing the headers and footers of the exported document. You can configure different headers and footers for the first page, odd pages, and even pages.

## Headers Configuration

The `headers` object allows you to customize the headers of your exported DOC document:

| Property             | Type      | Description                                                                                                                                                                              |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `evenAndOddHeaders`  | `boolean` | Whether to use different headers for odd and even pages                                                                                                                                  |
| `differentFirstPage` | `boolean` | Whether to use a different header on the first page. When `true`, the `first` value is used on page one instead of `default`.                                                            |
| `default`            | `string`  | The standard default header on every page, or header on odd pages when `evenAndOddHeaders` is active. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting. |
| `first`              | `string`  | The header on the first page. Only used when `differentFirstPage` is set to `true`. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting.                   |
| `even`               | `string`  | The header on even pages when the `evenAndOddHeaders` option is activated. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting.                            |

When using plain text, a simple unstyled header is produced. When using stringified Tiptap JSONContent (via `JSON.stringify()`), rich formatting such as bold, italic, and links is preserved.

## Footers Configuration

The `footers` object allows you to customize the footers of your exported DOC document:

| Property             | Type      | Description                                                                                                                                                                              |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `evenAndOddFooters`  | `boolean` | Whether to use different footers for odd and even pages                                                                                                                                  |
| `differentFirstPage` | `boolean` | Whether to use a different footer on the first page. When `true`, the `first` value is used on page one instead of `default`.                                                            |
| `default`            | `string`  | The standard default footer on every page, or footer on odd pages when `evenAndOddFooters` is active. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting. |
| `first`              | `string`  | The footer on the first page. Only used when `differentFirstPage` is set to `true`. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting.                   |
| `even`               | `string`  | The footer on even pages when the `evenAndOddFooters` option is activated. Accepts a plain text string or stringified Tiptap JSONContent for rich formatting.                            |

When using plain text, a simple unstyled footer is produced. When using stringified Tiptap JSONContent (via `JSON.stringify()`), rich formatting such as bold, italic, and links is preserved.

## Complete example

```js
import { ExportDoc } from '@tiptap-pro/extension-export-doc'

const editor = new Editor({
  extensions: [
    // Other extensions...
    ExportDoc.configure({
      token: 'YOUR_TOKEN',
      appId: 'YOUR_APP_ID',
      headers: {
        evenAndOddHeaders: true,
        default: 'My Document - Confidential',
        first: 'Welcome to My Document',
        even: 'My Document - Even Page',
      },
      footers: {
        evenAndOddFooters: true,
        default: 'Company Name - All Rights Reserved',
        first: 'Draft Version 1.0',
        even: 'Company Name - Even Page Footer',
      },
    }),
    // Other extensions...
  ],
})

// Export with headers and footers
editor
  .chain()
  .exportDoc({
    onCompleteExport(result) {
      const url = URL.createObjectURL(result)
      const a = document.createElement('a')

      a.href = url
      a.download = 'document-with-headers.doc'
      a.click()

      URL.revokeObjectURL(url)
    },
  })
  .run()
```

## Simple headers and footers

If you don't need different headers for odd/even pages, you can provide just the `default` values:

```js
ExportDoc.configure({
  token: 'YOUR_TOKEN',
  appId: 'YOUR_APP_ID',
  headers: {
    default: 'My Document Title',
  },
  footers: {
    default: 'Page Footer - Company Name',
  },
})
```
