avoutic / web-framework-browserless
The Browserless module for web-framework
dev-main
2025-03-29 15:16 UTC
Requires
Requires (Dev)
- phpstan/phpstan: ^2.0
This package is auto-updated.
Last update: 2025-03-29 17:30:39 UTC
README
A module for WebFramework that provides PDF generation capabilities using the Browserless service.
Installation
composer require avoutic/web-framework-browserless
Requirements
- PHP 8.2 or higher
- WebFramework 8.x
- A Browserless service instance
Configuration
If you are using the definition from definitions/defitinions.php. You can just add the following browserless.php to your auth config directory (config/auth):
<?php return [ 'local_server' => 'http://your-local-server', 'pdf_endpoint' => 'https://your-browserless-instance/pdf', 'token' => 'your-browserless-token' ];
Usage
The module provides methods to generate PDFs from web pages:
$browserless->outputPdf('/path/to/page', 'output.pdf'); // or $stream = $browserless->outputStream('/path/to/page');
License
MIT License - see LICENSE file for details