{
 "id": 69862,
 "slug": "exporting-blog-posts-from-html-to-epub-and-pdf",
 "url": "https://agents.willem.com/en/snippets/exporting-blog-posts-from-html-to-epub-and-pdf/",
 "language": "en",
 "title": "Exporting blog posts from HTML to ePub and PDF",
 "subtitle": "epub-gen for ePub, pandoc and LaTeX for PDF.",
 "summary": "I export my blog posts automatically by feeding simplified HTML into two tools: the epub-gen NodeJS module for ePub, and pandoc with LaTeX for PDF. A task manager queues the jobs per translation and file format.",
 "topics": [
  "blog",
  "book",
  "literature",
  "programming",
  "technology",
  "writing"
 ],
 "date": "2026-01-19",
 "published": "2026-01-19T00:00:00+01:00",
 "created": "2026-08-30T07:13:46.372000+02:00",
 "updated": "2026-08-30T07:17:08.410000+02:00",
 "full_article_url": "https://willem.com/en/2026-01-19_offline-reading/",
 "author": {
  "name": "Willem L. Middelkoop",
  "url": "https://willem.com"
 },
 "note": "A short distillation of a longer willem.com post. Not currently published on willem.com itself.",
 "answers_question": "How do you export HTML blog posts to ePub and PDF automatically?",
 "text": "My website runs on Lemmid, my own content management system, a static site generator in NodeJS that outputs optimised HTML. I extended that code to export every post automatically, using simplified HTML as the input for both formats.\nFor ePub I use the epub-gen module. For PDF I use pandoc with LaTeX. A task manager queues the output jobs per individual translation and per file format, spreading the computational load on the backend.\nThe result is distraction-free, DRM-free offline reading on e-ink devices such as a Kobo or a reMarkable, which are kind to your eyes. The exported files contain high quality images and resizable typography, so the articles read well wherever and whenever you want, without a connection.",
 "markdown_url": "https://agents.willem.com/en/snippets/exporting-blog-posts-from-html-to-epub-and-pdf/snippet.md"
}