PDF generation without Chromium dependency

Is generating PDFs on the server strictly required? I always generate PDFs on the client side when possible. The two main reasons are:

  1. I don’t waste CPU cycles and memory on the server with heavy libraries.
  2. JavaScript has better libraries to handle PDF generation on the client side.

I’ve been using paged.js and I’m very happy with the results. It even allows me to show a preview before printing to the client.

If you really need to create PDFs on the server side, the most popular library is PdfGenerator, which uses WKHTML instead of Chrome or Puppeteer.