The package can convert a webpage to an image or pdf. The conversion is done behind the scenes by Puppeteer which controls a headless version of Google Chrome.
Here's a quick example:
useSpatie\Browsershot\Browsershot;
// an image will be savedBrowsershot::url('https://example.com')->save($pathToImage);
It will save a pdf if the path passed to the save method has a pdf extension.
// a pdf will be savedBrowsershot::url('https://example.com')->save('example.pdf');
You can also use an arbitrary html input, simply replace the url method with html: