PHP code example of eckinox / php-puppeteer

1. Go to this page and download the library: Download eckinox/php-puppeteer 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/ */

    

eckinox / php-puppeteer example snippets




ckinox\PhpPuppeteer\Browser;

$config = [
	"url" => "https://github.com/eckinox/php-puppeteer"
];
$browser = new Browser();
$content = $browser->pdf($config);

header("Content-type:application/pdf");
echo $content



ckinox\PhpPuppeteer\Browser;

$config = [
	"html" => "<h1>Hello World!</h1>"
];
$browser = new Browser();
$content = $browser->pdf($config);

header("Content-type:application/pdf");
echo $content
bash
composer