PHP code example of kulizh / screenshot-pages

1. Go to this page and download the library: Download kulizh/screenshot-pages 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/ */

    

kulizh / screenshot-pages example snippets

 
use ScreenshotPages\Helpers\Parameters\ParametersInterface;

class HardcodeParameters implements ParametersInterface
{
    public function getSaveFolder(): string
    {
    	return './result/';
    }

    public function getSaveFormat(): string
    {
    	return 'jpeg';
    }
    
    public function getPages(): array
    {
    	return [
    		'https://www.wikipedia.org/'
    	];
    }

    public function getViewports(): array
    {
    	return [
    		'1920x1080'
    	];
    }
}

$capture = new Capture();
$capture->use(new HardcodeParameters);


use ScreenshotPages\Helpers\Parameters\AbstractParameters;

class PresetParameters extends AbstractParameters
{
	
}

$capture = new Capture();
$capture->use(new PresetParameters);

use ScreenshotPages\Capture;

$capture = new Capture();
$capture->verbose = true; // To see cli output

$capture->make();