You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
17
17
18
18
### 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.
20
20
21
21
## Usage
22
22
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
25
25
```php
26
26
use SynergiTech\ChromePDF\Chrome;
27
27
use SynergiTech\ChromePDF\Browserless;
28
+
use SynergiTech\ChromePDF\Browserless\Screenshot;
28
29
29
30
$pdf = new Chrome('path-to-chrome-pdf');
30
31
$pdf->renderContent('<h1>test</h1>');
31
32
32
33
$pdf = new Browserless('your-api-key');
33
34
$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.
0 commit comments