Download the PHP package voquis/pdfapi without Composer
On this page you can find all versions of the php package voquis/pdfapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download voquis/pdfapi
More information about voquis/pdfapi
Files in voquis/pdfapi
Package pdfapi
Short Description A PDF API for generating business documents
License MIT
Homepage https://github.com/voquis/pdfapi
Informations about the package pdfapi
Introduction
A PHP API for generating business documents in PDF format.
Usage
Once the API is running using one of the methods below, the following endpoints are available:
- POST /invoice
- POST /purchaseOrder
Sample invoice requests
Body data should be posted as raw content type.
Docker
To run the API as a Docker container, a single http endpoint needs to be exposed, for example to on the host machine:
To run in detached mode, add before the image name.
Development
The API uses the Laravel Lumen framework and makes use of voquis/pdflib, a library built on TCPDF.
Developing in Docker
First start a development container in detached mode and mount the source code as a volume:
To use the current directory instead of specifying the full local path, use . If using docker for windows, change paths to . Then connect to the running container in interactive mode () and to the TTY (-t). Note that if using git for Windows, the prefix may be required. If using CentOS/RHEL or other SELinux enabled distros, use (exclusive access to this container) or (shared with other containers) at the end of the volume mounts to set appropriate permissions, i.e. . See this StackOverflow question/answer for further details.
To disconnect and leave a container running use then .
Install and enable dependencies
Note that the base Docker PHP image has a utility for installing and enabling PHP extensions. The extension is used for parsing image logos in the header. The extension is used during tests and is not required for production (see for production optimisation).
Install tools
Install Xdebug and add config file. The xdebug extension is required for producing unit test coverage reports. The and options are only required if remote debugging will be used (port ).
Increase memory limit
Static code analysis (phpstan) may hit default PHP memory limits, to increase this, run the following. Note that this creates a new config file.
Install and run composer
Acquire the latest version of composer with and output () to system-wide binary path, following any redirects (). Update permissions to allow executing (). Instruct composer to check out from git with , this will allow development of any vendor libraries if required.
Configure writeable directories
Give apache permission to write to and sub-directories.
Configure Apache
Enable the apache2 module, then update the configs to change from default webroot directory to location of project files in mounted volume ().
Note that restarting apache2 will terminate the container so will need to run and then reconnect.
Contributing
Contributions are welcome in the form of issue reporting and pull-requests, please fork the repository with any proposed changes. Please ensure 100% unit test code coverage is maintained and that tests are run locally with before pushing your changes. To generate unit test coverage report, run . These commands are defined in under .
All versions of pdfapi with dependencies
laravel/lumen-framework Version 5.8.*
vlucas/phpdotenv Version ^3.3
voquis/pdflib Version 0.0.3-alpha