A WACZ is a good container for a web crawl. It plays back easily in open-source replay software like Browsertrix and ReplayWebPage. But it’s not always the most convenient format for a non-archivist who wants to read, annotate, print or file away a set of their articles. I worked with Claude to write a small CLI utility, wacz-pdf, that extracts all (or a subset) of the pages from a WACZ and writes them out as PDF files, one per page.
The pages come from the crawler’s own page list (pages/pages.jsonl), falling back to the CDX index for archives that don’t have one. Each page is then handled according to what it is. HTML gets replayed through wabac.js, Webrecorder’s own replay engine, running as a service worker inside headless Chromium, so the CSS, images and fonts are all served from the archive and the page renders the way it was captured. Then it’s printed with Playwright’s page.pdf().