I didn’t understand going through HTML to render it with a headless browser instead of rendering the PDF directly with Ghostscript or something like that.
1. I'm taking untrusted PDFs and running them on my machine. Using something like say puppeteer that PDF renderer runs in a sandbox. Ghostscript, not so much. PDFs can have code in them
2. Using HTML via puppeteer lets me render tons of other things I might want to render than just PDFs. Plenty if beautiful algorithmic art out there that runs in a browser.
(To be fair the device does HTML rendering by default and the API for pushing images isn’t super obvious)