> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/maintenance-and-troubleshooting/additional-troubleshooting/generating-different-headers-on-different-pages-in-pdf-templates.md).

# generating different headers on different pages in pdf templates

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

## ![(blue star)](https://1548664070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWKNnJmhJBQwhdk5WBFsi%2Fuploads%2Fgit-blob-f4eecca91b1e09e3aca0967be2bade2e18c1b384%2F1f4d8.png?alt=media) 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)](https://1548664070-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWKNnJmhJBQwhdk5WBFsi%2Fuploads%2Fgit-blob-9a2a5559fd6e70021150ea37346f9ecd089c4da4%2F1f4cb.png?alt=media) Related articles


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/sdocs/maintenance-and-troubleshooting/additional-troubleshooting/generating-different-headers-on-different-pages-in-pdf-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
