# generating different headers on different pages in pdf templates

Instructions on how to display different headers on each page of PDF documents

## ![(blue star)](/files/42399de1a41dacd09fbbc0d1891cf4b0f5acd188) Instructions

{% stepper %}
{% step %}
Enter the headers that you want for the main template in the “header” and "header on remaining pages" section. Ensure that “Use first page header for all pages” is unchecked.
{% endstep %}

{% step %}
Create another PDF template that can be named anything but for this example it will be called `pdfheader` (this should be a PDF template, not a component).
{% endstep %}

{% step %}
Keep the body section of the `pdfheader` template blank but add what you want to show for the header on the following pages of the main template in `pdfheader`'s "header on remaining pages" section.

If you want this to be blank you can add this HTML into that section's source code:

```
```

{% endstep %}

{% step %}
You can call the new header when needed at the start of its corresponding page in the main template like this:

```
```

This should overwrite the current header and replace it with the new one.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
You will need to create a different PDF template for each header that needs to be called.
{% endhint %}

## ![(blue star)](/files/aa87836b6ffe831ca0597150f13b5c60ec556a92) Related articles


---

# 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://help.sdocs.com/sdocs/maintenance-and-troubleshooting/additional-troubleshooting/generating-different-headers-on-different-pages-in-pdf-templates.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.
