minutemanservices / wkhtmltopdf-php-client
PHP Client Library for generating PDFs from HTML using our Wkhtmltopdf Microservice
1.0.7
2022-02-04 01:10 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.2
- illuminate/support: ^8.0
- illuminate/validation: ^8.0
- konekt/enum: ^3.1
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-05 01:42:46 UTC
README
Contribution guidelines
- Update the version constant in the
ApiClient
class. - Update the version in
composer.json
- Tag the commit with the same version number.
Requirements
php: >=7.4.0
illuminate/support: >=5.0.0
illuminate/validation: ^8.22
guzzlehttp/guzzle: ^7.2
konekt/enum: ^3.1
ext-json: *
Installing
composer require minutemanservices/wkhtmltopdf-php-client
Laravel Setup
php artisan vendor:publish --provider=MinuteMan\WkhtmltopdfClient\WkhtmltopdfServiceProvider
Usage
1. Create a Document
First, create a new instance of the ApiClient
class and provide the URL of the Wkhtmltopdf microservice API and your access key.
$apiClient = new MinuteMan\WkhtmltopdfClient\ApiClient($apiUrl, $apiKey);
Then, create an instance of WkhtmltopdfDocument
for each PDF you want to generate.
Pass the instance of the ApiClient
class to the PDF document instance.
$pdfDocument = new MinuteMan\WkhtmltopdfClient\WkhtmltopdfDocument($apiClient);
Laravel
In Laravel, you can create a document instance without having to create an ApiClient
instance.
$pdfDocument = app()->make(MinuteMan\WkhtmltopdfClient\WkhtmltopdfDocument::class);