Hacker News new | ask | show | jobs
by metadat 1351 days ago
Could satori be used to convert a whole webpage into a single SVG image?

Could be a (convoluted?) way to ensure an asset looks the same across all browsers..

2 comments

No, Satori does not guarantee that the SVG will 100% match the browser-rendered HTML output. That's because Satori implements its own layout engine based on the SVG 1.1 spec. However, Satori generated result (SVG) is stable on all browsers.
This was the use case I had in mind. My company generates exports that are either PDF or PNG/JPEG images from the DOM using Puppeteer. We really wanted to support SVG but every option we explored had pretty significant rendering issues, meaning an entire rewrite in SVG would have been required.