Converting a Reveal.js slide deck to PDF

Featured image for sharing metadata for article

Something I have to do every so often is convert one of my talks from their web form in Reveal.js to a PDF.

Ahead of speaking at DTX London tomorrow, I'm preparing a PDF as well as the web URL, and I've yet again forgotten how to do it, as it's just-infrequent-enough that I've not got it in my memory banks.

This is the perfect opportunity to write it as a form of blogumentation, so next time I don't have to try and remember!

We can use the excellent Decktape project to do the hard work.

To do so, we need to install decktape, which I prefer to do in a temporary directory, as it's so infrequently used it doesn't make sense to be a globally installed tool.

From there, we can run:

# NOTE that the URL and output filename may want to change
npm exec decktape reveal --fragments http://localhost:1313/dmd-dtx/slides/ dmd-dtx.pdf

Note that --fragments is required to handle Reveal.js' fragments (aka in-slide transitions) and will create a new page on the PDF per fragment.

Written by Jamie Tanna's profile image Jamie Tanna on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #revealjs.

This blog post is 100% human-written, and has nothing derived from LLMs (be it code, editorial support or prose).

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.