Download the PHP package actualreports/pdfgeneratorapi-laravel without Composer
On this page you can find all versions of the php package actualreports/pdfgeneratorapi-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download actualreports/pdfgeneratorapi-laravel
More information about actualreports/pdfgeneratorapi-laravel
Files in actualreports/pdfgeneratorapi-laravel
Package pdfgeneratorapi-laravel
Short Description PDF Generator API package for Laravel
License MIT
Homepage https://pdfgeneratorapi.com
Informations about the package pdfgeneratorapi-laravel
PDF Generator API for Laravel
This Laravel package creates controllers and routes to easily use the PDF Generator API service. It also includes javascript interface to print and download generated files, and to open templates in the editor view.
Install
Require this package with composer using the following command:
If you don't use Laravel 5.5 auto-discovery, add the service provider and the alias to config/app.php. If you run Laravel 5.5 this is done automatically.
Add provider
Add alias
Publishes configuration file to your config folder (config/pdfgeneratorapi.php)
Publishes javascript to your assets folder (resources/assets/vendor/pdfgeneratorapi/index.js)
Configuration
Add configuration to your .env file
If "PDF_GENERATOR_USE_DATA_URL" is set to true then we send an url to your data file instead of sending the data in request body. This feature exists because of the url length limitations. When we redirect user to the editor view with json data in query param then we have are limited to browser url length and the data string can be incomplete.
To make this feature work you need to link your public folder. Data files are saved to /storage/app/public/pdfgenerator
Usage
We have included the javascript interface that makes calls to routes defined below and displays the result in browser. If you need more flexibility you can create your own front end interface that use the routes.
Data Repository
The main controller depends on ActualReports\PDFGeneratorAPILaravel\Repositories\DataRepository to get the data that is sent to PDF Generator service. By default the data repository looks for the "data" parameter in request using Input::get('data').
You can add your own DataRepository by implementing interface ActualReports\PDFGeneratorAPILaravel\Contracts\DataRepository and overriding the binding in your AppServiceProvider.php register() function.
User Repository
The main controller depends on ActualReports\PDFGeneratorAPILaravel\Repositories\UserRepository
to generate unique workspace identifier for logged in user.
You can add your own UserRepository by implementing interface ActualReports\PDFGeneratorAPILaravel\Contracts\UserRepository
and overriding the binding
in your AppServiceProvider.php register() function.
Routes
Available routes
- pdfgenerator.templates.all: GET /pdfgenerator/templates
- pdfgenerator.templates.get: GET /pdfgenerator/templates/{template}
- pdfgenerator.templates.output: GET|POST /pdfgenerator/templates/{template}/{output}/{format}
- pdfgenerator.templates.new: GET|POST /pdfgenerator/templates/new
- pdfgenerator.templates.edit: GET|POST /pdfgenerator/templates/{template}/edit
- pdfgenerator.templates.copy: GET|POST /pdfgenerator/templates/{template}/copy
JavaScript interface
Init javascript interface
Fetches list of available templates
Executes print command that generates the document and opens browser print dialog
Executes download command that generates the document and starts download automatically
Executes inline command that generates the document and opens it in new tab/window
Opens new tab/window with template editor
Creates a copy of a given template and opens new tab/window with template editor
All versions of pdfgeneratorapi-laravel with dependencies
php Version ~5.6|~7.0
actualreports/pdfgeneratorapi-php Version ^1.0