# \[Plugin\] PDF Header & Footer: a header, footer and page numbers on every page of exported PDFs

**URL:** <https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428>\
**Category:** Plugins\
**Created:** [6 November 2026 07:51 UTC](https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428 "2026-11-06T07:51:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnoahc](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tnoahc/32/30723_2.png) [@tnoahc](https://discourse.joplinapp.org/u/tnoahc)\
**Post date:** [6 November 2026 07:51 UTC](https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428/1 "2026-11-06T07:51:02Z")

</div>

I needed every PDF I export from Joplin to carry my company's header and tagline. So far I'd been hard-coding them in the custom stylesheet, which had two problems. The text only appeared once (at the top of the first page and at the end of the note), and changing it meant editing CSS. This plugin replaces that with a settings page.

 ![Screenshot From 2026-11-06 10-39-20](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/c/5/c5425296ff6e480b61ee4631549bd50d1311c5b6.jpeg)

## What is it?

A plugin that adds a header and footer to **every page** of a note when you export it to PDF. You type the text in Joplin's settings, with no CSS editing, and you can add page numbers and the date.

**Repository:** [GitHub - tnoahc/joplin-pdf-header-footer · GitHub](https://github.com/tnoahc/joplin-pdf-header-footer)

## Why this exists

Many of us have to produce documents that follow a house style: a company name at the top, a tagline or confidentiality line at the bottom, and page numbers. Joplin's PDF export doesn't offer that. Pasting CSS into `userstyle.css` gets you part of the way, but `::before`/`::after` rules only print once per document, not once per page. And the text is buried in a stylesheet.

## Current state

Version 1.0.0, released as a small `.jpl` with no dependencies. It's plain JavaScript, so there's no build step. I've tested it on Joplin desktop 3.7.21 (Linux) in development mode, exporting multi-page notes to PDF.

**What works:**

| Feature | Status |
| --- | --- |
| Header on every page: left, centre and right text | ✅ |
| Footer on every page: left, centre and right text | ✅ |
| Placeholders: `{page}`, `{pages}`, `{date}` | ✅ |
| Optional separator lines under the header and above the footer | ✅ |
| Adjustable font size and top and bottom page margins | ✅ |
| Note viewer unaffected (only exported PDFs change) | ✅ |
| File → Print | ❌ (see Caveats) |

For example, `Page {page} of {pages}` in the footer prints "Page 2 of 5".

## How it works

My first idea was to use Electron's built-in header and footer options for `printToPDF` (`displayHeaderFooter`, `headerTemplate`, `footerTemplate`). Reading `InteropServiceHelper.ts` showed that this route is closed. Joplin builds the print options itself, and a plugin can't add to them.

Two other details in the same code made a plugin possible:

1. To make a PDF, Joplin first exports the note to HTML **with plugin content scripts applied** , then prints that HTML in a hidden window.
2. It prints with `preferCSSPageSize: true`, so the document's own CSS `@page` rules are respected.

So the plugin is a Markdown-it content script. It adds a `<style>` block with `@page` **margin boxes** (`@top-left`, `@bottom-right` and so on) to the rendered note. Chromium has supported these since version 131, and they repeat on every printed page. `counter(page)` and `counter(pages)` provide the page numbers. The content script reads your settings through `pluginOptions.settingValue()`, which also works during export. Because `@page` rules only apply in print, the viewer looks the same.

## Setup

1. Download `plugin.tnoahc.pdf-header-footer.jpl` from the [latest release](https://github.com/tnoahc/joplin-pdf-header-footer/releases/latest).
2. Go to **Tools → Options → Plugins → ⚙ → Install from file** , choose the file, and restart Joplin.
3. Fill in the text under **Tools → Options → PDF Header & Footer**.
4. Export as usual with **File → Export → PDF**.

If your custom stylesheet already adds a header or footer through `.exported-note::before`/`::after`, remove those rules so the text doesn't appear twice.

Requires Joplin desktop 3.2 or later.

## What's next

Ideas I'm considering. Tell me which would be most useful:

- A different header (or none) on the first page
- A logo image in the header
- Different header and footer text per notebook
- The note title as a placeholder
- Submission to the official plugin repository

## Caveats

- **File → Print doesn't include the header and footer.** Joplin's print command doesn't load plugins, unlike the PDF export. Export to PDF first, then print the PDF.
- The note title isn't available as a placeholder yet. Joplin already prints it at the top of the note.
- Joplin's own PDF margin settings may interact with the plugin's margin settings. Adjust the top and bottom margins if the header sits too close to the edge.
- This was developed with AI assistance (Claude).

Feedback, bug reports and contributions are welcome. I'm particularly interested in how it behaves with other page sizes, other operating systems and custom stylesheets.

---

<div class="post-metadata">

**Author:** ![Bergstrasse](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Bergstrasse](https://discourse.joplinapp.org/u/Bergstrasse)\
**Post date:** [10 November 2026 09:34 UTC](https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428/2 "2026-11-10T09:34:40Z")

</div>

Thank you for this plugin. Much simpler then CSS fiddling for printouts.

My feedback and ideas for future versions:

- Submission to the official plugin repository would be great
- Note title as a placeholder would be great
- No header on the first page would be great
- Draw lines should be set separate by header and footer
- Options for left and right margins would be great

---

<div class="post-metadata">

**Author:** ![tnoahc](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tnoahc/32/30723_2.png) [@tnoahc](https://discourse.joplinapp.org/u/tnoahc)\
**Post date:** [27 November 2026 16:34 UTC](https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428/3 "2026-11-27T16:34:43Z")

</div>

Thank you for the feedback! The plugin is now available in the official repository, you can find it by searching for PDF Header & Footer in Joplin’s plugin settings.

Separate header/footer line controls, left/right margins, and an option to hide the header on the first page all sound useful. I’ll also investigate a note-title placeholder. I want to make sure it uses the correct title when exporting multiple notes.

For the first-page option, would you expect the header space to remain empty, or the note content to move up into that space?

---

<div class="post-metadata">

**Author:** ![Bergstrasse](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@Bergstrasse](https://discourse.joplinapp.org/u/Bergstrasse)\
**Post date:** [28 November 2026 13:43 UTC](https://discourse.joplinapp.org/t/plugin-pdf-header-footer-a-header-footer-and-page-numbers-on-every-page-of-exported-pdfs/51428/4 "2026-11-28T13:43:16Z")

</div>

Thank your for your reply and making the plugin available in the offical repository.

Regarding your question about first page option: I would expect the note content move up. Feels more natural.

Another point you may consider, is to make it possible having the note's creation and modification date as variable.
