Live data from Hacker News

Ask HN: How to Convert HTML to PNG on a Serverside?

news.ycombinator.com

11–16 of 16 posts

Re: Ask HN: How to Convert HTML to PNG on a Serverside?

#11

Does it need to be HTML? SVG is easy to generate programmatically, and doesn't need to be converted.

I was considering HTML, since I know that it's pretty easy to represent with help of it what I need :) Haven't worked with SVG before, but apparently I have to look on it closer Thanks!

Re: Ask HN: How to Convert HTML to PNG on a Serverside?

#14
I'm currently bootstrapping an api/sass that takes any url and converts it to an image. It runs on top of chromium and uses the CDP protocol to do cool things like automate basic auth, custom http headers, injected js, mock mobile templates and device emulation, custom interactions with the webpage, it can also return json or upload the results to dropbox, s3, or google cloud storage. I'm looking to chat with people interested in this kind of technology as I polish off the final touches on the API and get the product live!

What kind of features would be useful to you if you were to go the API route for something like this?

Re: Ask HN: How to Convert HTML to PNG on a Serverside?

#15

Headless chrome/puppeteer...

No-no Headless chrome / firefox doesn't work here, since I need to run Selenium on the server and that's the most obvious overhead because any browser, even in a headless mode consumes RAM. This becomes even more critical if you need to process more than 100 images per minute :|

Selenium can also snapshot pages.
Post reply on HN