PHP Class Spatie\Browsershot\Browsershot

Afficher le fichier Open project: spatie/browsershot Class Usage Examples

Protected Properties

Свойство Type Description
$backgroundColor string
$binPath string
$height integer
$quality integer
$timeout integer
$url integer

Méthodes publiques

Méthode Description
__construct ( $binPath = '', $width = 640, $height = 480, $quality = 60, $timeout = 5000, $backgroundColor = null )
save ( string $targetFile ) : boolean Convert the webpage to an image.
setBackgroundColor ( string $backgroundColor ) Set the background color.
setBinPath ( string $binPath )
setHeight ( integer $height )
setHeightToRenderWholePage ( ) Set to height so the whole page will be rendered.
setQuality ( $quality ) Set the image quality.
setTimeout ( integer $timeout )
setUrl ( string $url )
setWidth ( integer $width )

Méthodes protégées

Méthode Description
getPhantomJsScript ( string $targetFile ) : string Get the script to be executed by phantomjs.
takeScreenShot ( $targetFile ) Take the screenshot.

Method Details

__construct() public méthode

public __construct ( $binPath = '', $width = 640, $height = 480, $quality = 60, $timeout = 5000, $backgroundColor = null )

getPhantomJsScript() protected méthode

Get the script to be executed by phantomjs.
protected getPhantomJsScript ( string $targetFile ) : string
$targetFile string
Résultat string

save() public méthode

Convert the webpage to an image.
public save ( string $targetFile ) : boolean
$targetFile string The path of the file where the screenshot should be saved
Résultat boolean

setBackgroundColor() public méthode

Set the background color.
public setBackgroundColor ( string $backgroundColor )
$backgroundColor string

setBinPath() public méthode

public setBinPath ( string $binPath )
$binPath string

setHeight() public méthode

public setHeight ( integer $height )
$height integer

setHeightToRenderWholePage() public méthode

Set to height so the whole page will be rendered.

setQuality() public méthode

Set the image quality.
public setQuality ( $quality )
$quality

setTimeout() public méthode

public setTimeout ( integer $timeout )
$timeout integer

setUrl() public méthode

public setUrl ( string $url )
$url string

setWidth() public méthode

public setWidth ( integer $width )
$width integer

takeScreenShot() protected méthode

Take the screenshot.
protected takeScreenShot ( $targetFile )
$targetFile

Property Details

$backgroundColor protected_oe property

protected string $backgroundColor
Résultat string

$binPath protected_oe property

protected string $binPath
Résultat string

$height protected_oe property

protected int $height
Résultat integer

$quality protected_oe property

protected int $quality
Résultat integer

$timeout protected_oe property

protected int $timeout
Résultat integer

$url protected_oe property

protected int $url
Résultat integer