Printed Spellbooks for the Pen and Paper Purist

You can now take your spellbooks offline with PDFs you can print.

I built the 5e Spellbook Builder because there were no cards for the 2024 edition's spells. Then I was so happy with how building spellbooks and flipping through the spellcards on my phone felt at the table that I left it.

5e Spellbook Builder was done. I wanted to make a tool for me and I succeeded.

I was so satisfied with what I made that I took a step I never take with any of my hobby projects — I announced on Reddit that I had built this tool — and fortunately the community was super nice and supportive

I loved hearing positive feedback and seeing other tables actually use it. Or at least, that's what I can infer from some of the traffic metrics.

But one piece of feedback kept coming up:

"Any plans on a feature to export as PDFs or batch-print cards?"

"This is great but I'd love a way to print my spellbook"

"Would love to print"

"One thing that would be super helpful is a printing option! Did I miss that?"

Funny enough, this was the obvious feature for players like me who don't want screens at the table, yet I kept ignoring it. I grew to like using my phone to flip through cards instead of pulling out a binder.

That, and ... well, generating PDFs sucks.

If there's one task I hate in web development, it's generating PDFs programatically. It's finicky. It's lots of trial and error. You have to write strange styling rules that don't make sense in a browser but somehow turn out okay in a PDF.

The task was made even harder because 5e Spellbook Builder runs directly on your device. When you visit the website, the entire application's code is loaded up in your browser. The data you make resides only on your machine. There's no server running any of the logic and recording your data. It makes the experience fast, as fast as it can be, which is what I wanted when I built it. But it also means I don't have a server that can generate PDFs. Instead your browser has to figure it out.

I figured it out using html2pdf.js, and I was surprised that my spellcard layouts mostly carried over intact to the PDF. I'll get technical here for a moment for the few of you that might be into it — but I had to inline my styles, use hard-coded card and page pixel sizes to ensure generated PDFs looked nearly the same regardless of the device screen size you had, and assemble PDFs page-by-page instead of at once so big spellbooks wouldn't exceed browser canvas limitations and produce a blank screen.

It's done and it works. I think. To print your spellbooks, click Print on any of the spellbooks on Your Spellbooks.

If you have a device that isn't producing satisfactory results, click the Share feedback link in the footer and let me know.

And if you are getting satisfactory results, share it! I'd love to see the spellbooks you are making.