ambersive / pdfprinter
This package for laravel provides a simple way to create pdf documents. This packages requires a running instance of the PRINT-API (also open sourced).
Installs: 2 631
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 0
Open Issues: 3
Requires
- guzzlehttp/guzzle: ^6.5|7.*
- illuminate/support: 6.*|7.*|8.*
- phlak/semver: ^3.2
Requires (Dev)
- php: >=7.4
- illuminate/support: 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
- laravel/framework: 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
- orchestra/testbench: 3.8.*|4.*|5.*|6.*
- phpunit/phpunit: ^9.3@dev
This package is auto-updated.
Last update: 2024-12-26 13:17:46 UTC
README
This package is a wrapper for the PRINT-API from AMBERSIVE KG. This package requires this endpoint otherwise you will not be able to create any pdf document.
Installation
composer require ambersive/pdfprinter
Usage
Please be aware that you will need a running instance of the PRINT-API. Otherwise the methods won't work as expected.
// Setup the pdf printer $printer = new PdfPrinter($settings); $printer->create("http://localhost:8080/pdf")->save("folder");
The full possiblities
// Setup the pdf printer $settings = new PdfPrinterSetting("http://localhost", 3000); $printer = new PdfPrinter($settings); $options = new PdfPrinterOption( $filename, $postBackUrl, [], //$postBackBody "" // $token ); // Set auth header for basic authentication $username = "test"; $password = "asdf"; $printer->authBasic($username, $password); // Set auth header for basic authentication $printer->authBearer("CUSTOM OR JWT TOKEN"); $printer->create("http://127.0.0.1:8000", null, function($instance, $result, $options, $successful) { // Will be executed after print execution })->save('test', null, function($instance, $result, $filename, $path, $successful){ // Do stuff after storing (even called if store was not successful) });
How to create beautiful documents
While this package is a connection between the print server and your laravel application (so it's a helper method), we also created a package document-viewer which will help you to create printable documents. The document viewer will help you to define the required routes for getting and uploading the files. And it will even give you a smooth way to delare "Printables".
Security Vulnerabilities
If you discover a security vulnerability within this package, please send an e-mail to Manuel Pirker-Ihl via manuel.pirker-ihl@ambersive.com. All security vulnerabilities will be promptly addressed.
License
This package is open-sourced software licensed under the MIT license.