Skip to content

Commit bc0b0ac

Browse files
committed
Update README.md
1 parent 2b8d038 commit bc0b0ac

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ composer require synergitech/chrome-pdf-php
1616
If you are planning to use the [`chrome-pdf`](https://github.com/SynergiTech/chrome-pdf) driver to render PDFs locally, you should also make sure to install this from npm.
1717

1818
### browserless
19-
If you are planning to use the [browserless](https://www.browserless.io/) driver to render PDFs remotely, you should register for an API key. Remember that local assets cannot be rendered by browserless.
19+
If you are planning to use the [browserless](https://www.browserless.io/) driver to render PDFs remotely or take screenshots, you should register for an API key. Remember that local assets cannot be rendered by browserless.
2020

2121
## Usage
2222
A common interface is provided via AbstractPDF. The options presented via this class will be available from all drivers.
@@ -25,12 +25,22 @@ You should instantiate one of the available drivers, potentially passing options
2525
```php
2626
use SynergiTech\ChromePDF\Chrome;
2727
use SynergiTech\ChromePDF\Browserless;
28+
use SynergiTech\ChromePDF\Browserless\Screenshot;
2829

2930
$pdf = new Chrome('path-to-chrome-pdf');
3031
$pdf->renderContent('<h1>test</h1>');
3132

3233
$pdf = new Browserless('your-api-key');
3334
$pdf->renderContent('<h1>test</h1>');
35+
36+
// For information on options, see https://www.browserless.io/docs/screenshot#custom-options.
37+
// `render()` defaults to using jpeg with a quality of 75 and fullPage set to false.
38+
$file = new Screenshot('your-api-key');
39+
$file->render('https://example.com');
40+
$file->render('https://example.com', [
41+
'fullPage' => true,
42+
'type' => 'png',
43+
]);
3444
```
3545

3646
## Examples

0 commit comments

Comments
 (0)