Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sharing in case anyone isn't familiar with this built-in capability:

google-chrome --headless --screenshot=my_screenshot.png https://www.example.com



It looks like this app has helpful functions for size, format, and transparency that you can't do with the built in chrome command all at once without probably piping it through inagemagik or something. And even then maybe this site renders the html responsively before rasterizing.


Actually Chrome does everything. Not via command-line switches however, you need to use the DevTools protocol. For example using Playwright. You get PDFs and PNGs of any size and resolution (PPI).

And I guess this is exactly what this service does under the hood.


This is interesting. If I have DevTools open, is there JS I can run to execute the PNG generation?


This is for the dozen or so people that don't have Chrome installed.


I personally haven't had Chrome installed anywhere in years. I think there are more than a dozen of us!


(checks list) --Mh, yah so, you've got a point there (scribbles, smiles, extends hand) --Welcome dear Sir or Madam, or, as we will call you, Number Thirteen!


I have this PC for over 2 years and did not realize I didn't have Chrome installed until Google's Antigravity prompted me to do so for its agent.

So it's installed now but still un-personalized like it was installed 5 minutes ago. I don't use it except with Antigravity.


At work we are using this feature. A lot of time we need to do some kind of pdf reporting. We built them as html pages and print them as pdf.

Works fine.


But is this “production-ready”?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: