1. Go to this page and download the library: Download oasys/chrome-pdf 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/ */
oasys / chrome-pdf example snippets
declare(strict_types=1);
use Oasys\Pdf\ChromePdf;
$pdf = new ChromePdf();
$pdf->save(
html: '<h1>Hello world</h1>',
output: __DIR__ . '/document.pdf'
);
$pdf = new ChromePdf();
$pdf = new ChromePdf(
binary: 'chromium'
);
$pdf = new ChromePdf(
binary: 'C:\Program Files\Google\Chrome\Application\chrome.exe'
);