PHP Client to interact with AirLST Headless Browser service.
You can install the package via Composer:
composer require airlst/headless-browser-client
Initialize the headless browser client with your API key.
$headlessBrowser = new \AirLST\HeadlessBrowserClient\AirlstHeadlessBrowser('api-key-here');
$headlessBrowser->pdf(
'<p>html</p>', // html content
[10, 10, 10, 10] // margins
'A4', // page size
);
$headlessBrowser->pdf(
'<p>html</p>', // html content
[10, 10, 10, 10] // margins
null, // Page size must be null otherwise it will override the custom width and height
'80mm', // width
'60mm', // height
);
$headlessBrowser->jpeg(
'<p>html</p>', // html content
80, // quality
);
All methods return the \Airlst\HeadlessBrowserClient\Response
object.
Provides 2 public methods:
temporaryUrl()
- returns a temporary file URL stored in the S3 bucket. Expires in 5 minutes after generationcontents()
- downloads file from S3 bucket and returns contents of the file as string
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.