# Customizable Print to PDF Button

**URL:** https://meta.discourse.org/t/customizable-print-to-pdf-button/400340
**Category:** Theme component
**Created:** [April 9, 2026, 5:29pm UTC](https://meta.discourse.org/t/customizable-print-to-pdf-button/400340 "2026-04-09T17:29:31Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![putty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/putty/32/370902_2.png) [@putty](https://meta.discourse.org/u/putty)
#### Post date: [April 9, 2026, 5:29pm UTC](https://meta.discourse.org/t/customizable-print-to-pdf-button/400340/1 "2026-04-09T17:29:31Z")

</div>

| ℹ | **Summary** | Add a clean print button to topics |
| --- | --- | --- |
| 👓 | **Preview** | [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/t/frozen-a-didactic-moral-tale-of-emotional-growth-and-inclusivity-disctoc-example/1788?preview_theme_id=10569) |
| 🛠 | **Repository** | [GitHub - dereklputnam/discourse-pdf-download](https://github.com/dereklputnam/discourse-pdf-download) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

I wanted to give my users a more elegant way to print the contents of a topic than [the stock print method](https://meta.discourse.org/t/printing-a-topic-as-a-pdf/160061). This allows specifying specifically which topics the button appears in, adding or removing elements, and adding a table of contents if the user wants it.

* * *

# Screenshots

It mimics your site’s button styles, providing both primary and secondary color palettes.

 ![CleanShot 2026-04-09 at 13.14.56](https://global.discourse-cdn.com/meta/original/4X/8/6/d/86df043f1aa25b588bc8d24f612b55f427c6f0cd.png)

 ![CleanShot 2026-04-09 at 13.22.49](https://global.discourse-cdn.com/meta/original/4X/0/e/6/0e6ca39eec3e22a110776af838b176f3fb12bf3f.png)

When a table of contents is detected, the option to include/exclude the outline is provided:

 ![CleanShot 2026-04-09 at 13.07.39](https://global.discourse-cdn.com/meta/original/4X/0/0/f/00fe7339136f95cb98b2588c8357a6b3d697d015.png)

> ✅ I also added the ability to limit how deep the table of contents looks for headers, to help balance usefulness and practicality.

 ![CleanShot 2026-04-09 at 13.07.52](https://global.discourse-cdn.com/meta/original/4X/f/9/2/f924e5fe50bac9f075e080b7257db67427279f9b.png)

> See [the Theme Creator Site for a live demo of an outline being added](https://discourse.theme-creator.io/t/frozen-a-didactic-moral-tale-of-emotional-growth-and-inclusivity-disctoc-example/1788?preview_theme_id=10569). I couldn’t figure out how to enable DiscoTOC there, but it’s detecting it anyway 😅.

* * *

# Settings

| Setting | Description |
| --- | --- |
| `enabled_categories` | Categories where the button appears |
| `enabled_tags` | Tags where the button appears |
| `enabled_topic_ids` | Specific topic IDs to always show the button |
| `first_post_only` | Only include the original post |
| `show_post_meta` | Show author and date in the PDF |
| `show_site_logo` | Show the site logo in the PDF header |
| `show_tags` | Show topic tags in the PDF header |
| `show_toc` | Enable the outline feature and checkbox |
| `toc_max_depth` | Heading depth for the outline |
| `button_style` | Secondary (outline) or primary (filled) |

* * *

I built this without using the object editor, but now I can see some value in having different button treatments depending on where it is located. Such as including the first post only or including/excluding author data. Happy to hear thoughts and tweak it though!

---

_[View the full topic](https://meta.discourse.org/t/customizable-print-to-pdf-button/400340)._
