1. Go to this page and download the library: Download andrew72ru/web-to-print library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
andrew72ru / web-to-print example snippets
$logger = new \Psr\Log\NullLogger(); // Choose your Psr\Log\LoggerInterface implementation
$runner = new \Andrew72ru\Web2print\DriverRunner($logger, '/path/to/chromedriver');
$printer = new \Andrew72ru\Web2print\PrintToPdf($runner, $logger);
$result = $printer('https://google.com', asBas64: true); // You can get Base64 or binary string
\file_put_contents('google.pdf', \base64_decode($result));