# Headers & Footers

{% hint style="warning" %}
**Important**: This feature is only available for PDF export.
{% endhint %}

## Adding headers and footers

Custom headers and footers can be defined for the pages meant to be exported. These texts will be displayed on all pages in the appropriate header/footer field.

On the export dialog's  **Formatting tab** a summary shows headers and footers in the **Headers/Footers** section.

1\. To define headers or footers, click on the **Headers/Footers** section:

<figure><img src="/files/1sahiedmBgDUViwIEaZF" alt=""><figcaption><p>Headers &#x26; Footers section</p></figcaption></figure>

Enter any text or select some pre-defined fields from the drop-down lists under the text box by selecting it and clicking the <img src="/files/AaD2EjLHVloT4oBEuxcO" alt="" data-size="line"> button. Clicking the add button inserts the selected value into the text field next to it.

<figure><img src="/files/57Cf8QhXnIcd7IIm4Tlp" alt=""><figcaption><p>Adding predefined headers &#x26; footers</p></figcaption></figure>

Content in headers/footers is handled as HTML. This allows text to be formatted using HTML formatting and styles. Inserting images is also possible. For displaying  XML/HTML in the header/footer, they have to be manually escaped.

3\. Use the checkbox to show or hide the footers on the cover pages.

<figure><img src="/files/iG2uUT3PRmCpK5sWIs5d" alt=""><figcaption></figcaption></figure>

## Formatting dates <a href="#headersandfooters-formattingdates" id="headersandfooters-formattingdates"></a>

By default dates are shown in the format 'dd.MM.yyyy HH:mm', which produces the following output: 30.08.2022 09:54.&#x20;

1\. To change the default format, provide a custom date format after the field. The syntax for formatting is the following:

```java
[{FIELD_NAME} '{format string}'}].
```

### **Fields**

The following fields are date fields, so you can use the formatting on them:

* `[DOCUMENT_LAST_MODIFIED]`
* `[DOCUMENT_CREATED]`
* `[EXPORT_DATE]`

### **Format string** <a href="#formatdates" id="formatdates"></a>

Format string is built up from formatting symbols. The following table lists the formatting symbols and their meanings with examples.

<table><thead><tr><th width="132.33333333333331">Symbol</th><th>Date or time component</th><th>Example</th></tr></thead><tbody><tr><td>y</td><td>Year</td><td>2022, 22</td></tr><tr><td>M</td><td>Month in year</td><td>08</td></tr><tr><td>d</td><td>Day in month</td><td>30</td></tr><tr><td>E</td><td>Day in week</td><td>Wed</td></tr><tr><td>H</td><td>Hour in 24h format</td><td>09</td></tr><tr><td>m</td><td>Minute</td><td>54</td></tr><tr><td>s</td><td>Second</td><td>32</td></tr></tbody></table>

Some examples using the date for last modified: 2022-08-30 09:54:32

| Format                                          | Result             |
| ----------------------------------------------- | ------------------ |
| \[DOCUMENT\_LAST\_MODIFIED 'yyyy.MM.dd. HH:mm'] | 2022.08.30. 09:54  |
| \[DOCUMENT\_LAST\_MODIFIED 'dd/MM/yy EEEE']     | 30/08/22 Wednesday |
| \[DOCUMENT\_LAST\_MODIFIED 'E d. MMM yyyy']     | Tue 30. Aug 2022   |
| \[DOCUMENT\_LAST\_MODIFIED 'HH:mm:ss']          | 09:54:32           |
| \[DOCUMENT\_LAST\_MODIFIED 'H:m:s']             | 9:54:32            |

Find more details about formatting symbols in the Oracle documentation: [Customizing Formats in java](http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html).

## Inserting images into headers and footers <a href="#headersandfooters-insertingimagesintoheader-footer" id="headersandfooters-insertingimagesintoheader-footer"></a>

1\. To insert an image, insert the HTML source in the header or the footer:

```html
<img width=100px src="https://marketplace-cdn.atlassian.com/files/5b8a1b46-bdb7-4039-9bc5-c08f1f1eb746?fileType=image&mode=full-fit" alt="logo" border="0">
```

2\. The link of an image may also be inserted from a Confluence space, as long as the exporting user has read permissions for the page containing the image:

```html
<img width=100px src="https://metainf.atlassian.net/wiki/download/thumbnails/70432009/profile-headers_footers.png?version=1&modificationDate=1501685540432&cacheVersion=1&api=v2&width=328&height=250" alt="logo" border="0">
```

{% hint style="danger" %}
**Important**: Due to current technical limitations, width must be given to resize the image. The height attribute is ignored.
{% endhint %}

<figure><img src="/files/e4yOBMiiRlMGlWWSysuT" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The current version won't be able to show a preview of the image on the Headers & Footers UI.
{% endhint %}

<figure><img src="/files/2e4HxaTgtQ6k0WwfPIbU" alt=""><figcaption></figcaption></figure>

## Showing the cover page title <a href="#headersandfooters-showcoverpagestitle" id="headersandfooters-showcoverpagestitle"></a>

By default Content Exporter does not export the title of the cover pages, however, it is possible to show it with the insertion of the following CSS code into the custom stylesheet:

```css
.cover-page.front-cover .wiki-title {
    display: block;
}

.cover-page.back-cover .wiki-title {
    display: block;
}
```

For more information, see [Custom Stylesheets](/content-exporter-confluence/user-guides/before-exporting/custom-stylesheets.md).

## Page numbering

The first and last numbered page can be selected:  Cover page, Table of Contents, first exported page.

{% hint style="info" %}

**Note:** The document hierarchy is the following.

1. Front cover page
2. Table of contents (can be multiple pages)
3. Exported page(s)
4. Back cover page
   {% endhint %}

<figure><img src="/files/kPnU4y9qSCokUgiAeFQw" alt=""><figcaption></figcaption></figure>

| Starts on            | Definition                                                                         |
| -------------------- | ---------------------------------------------------------------------------------- |
| Cover page (Default) | The page counting starts from the cover page (if it is exists).                    |
| Table of Contents    | The page numbering starts on the Table of Contents page.                           |
| First exported page  | The page counting starts in the first exported page (after the Table of Contents). |

| Ends on                   | Definition                                                 |
| ------------------------- | ---------------------------------------------------------- |
| Last exported page        | Ends on the last exported page before the back cover page. |
| Back cover page (Default) | The counting stops at the end of your back cover page.     |


---

# 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.meta-inf.hu/content-exporter-confluence/user-guides/before-exporting/export-profiles/headers-and-footers.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.
