Property | Type | Description | |
---|---|---|---|
$binary | the name of the wkhtmltoimage binary. Default is wkhtmltoimage. You can also configure a full path here. | ||
$commandOptions | options to pass to the Command constructor. Default is none. | ||
$ignoreWarnings | whether to ignore any errors if some PDF file was still created. Default is false. | ||
$tmpDir | the directory to use for temporary files. If null (default) the dir is autodetected. | ||
$type | the image type. Default is 'png'. Other options are 'jpg' and 'bmp'. |
Property | Type | Description | |
---|---|---|---|
$_command | the command instance that executes wkhtmltopdf | ||
$_error | the detailed error message. Empty string if none. | ||
$_isCreated | whether the PDF was created | ||
$_options | options for wkhtmltoimage as array('--opt1', '--opt2'=>'val', ...) | ||
$_page | the page input or a File instance for HTML string inputs | ||
$_tmpImageFile | the temporary image file |
Method | Description | |
---|---|---|
__construct ( array | string $options = null ) | ||
getCommand ( ) : |
||
getError ( ) : string | ||
getImageFilename ( ) : string | ||
getMimeType ( ) : string | ||
saveAs ( string $filename ) : boolean | Save the image to given filename (triggers image creation) | |
send ( string | null $filename = null, boolean $inline = false ) : boolean | Send image to client, either inline or as download (triggers image creation) | |
setOptions ( array $options = [] ) : static | Set options | |
setPage ( string $page ) : static | Add a page object to the output |
Method | Description | |
---|---|---|
createImage ( ) : boolean | Run the Command to create the tmp image file |
public __construct ( array | string $options = null ) | ||
$options | array | string | global options for wkhtmltoimage, a page URL, a HTML string or a filename |
protected createImage ( ) : boolean | ||
return | boolean | whether creation was successful |
public getCommand ( ) : |
||
return | the command instance that executes wkhtmltopdf |
public getImageFilename ( ) : string | ||
return | string | the filename of the temporary image file |
public getMimeType ( ) : string | ||
return | string | the mime type for the current image |
public send ( string | null $filename = null, boolean $inline = false ) : boolean | ||
$filename | string | null | the filename to send. If empty, the PDF is streamed inline. Note, that the file extension must match what you configured as $type (png, jpg, ...). |
$inline | boolean | whether to force inline display of the image, even if filename is present. |
return | boolean | whether image was created successfully |
public setOptions ( array $options = [] ) : static | ||
$options | array | list of image options to set as name/value pairs |
return | static | the Image instance for method chaining |
protected $_options |
protected $_page |
public $binary |
public $commandOptions |
public $ignoreWarnings |
public $tmpDir |