Small example PHP web service that uses Oicana for PDF templating.
- Install dependencies:
composer install - Follow the Oicana installer output to enable the native extension:
- The installer will attempt to download the extension automatically
- You need to extend the value of
PHP_INI_SCAN_DIRas shown in the installer output - Verify the extenaion is loaded:
php -m | grep oicana
- Download the RoadRunner binary and place it in your
PATH(or in the project root) - Start the service:
rr serve - Visit http://127.0.0.1:3004 for the Swagger UI documentation
The service uses RoadRunner as a long-running PHP application server. Templates are compiled once at startup and kept in memory across all requests.
GET /- API documentationGET /templates- List all available templatesPOST /templates/{id}/compile- Compile template to PDFPOST /templates/{id}/preview- Preview template as PNGPOST /templates/{id}/reset- Reset template cacheGET /templates/{id}- Download template ZIP filePOST /blobs- Upload a blob (image, file, etc.)POST /certificates- Create a certificate PDF
The code of this example project is licensed under the MIT license.
But please be aware, that the Oicana dependency is licensed under PolyForm Noncommercial License 1.0.0 and requires a commercial License for use cases that are not covered by the PolyForm License. Visit the Oicana website for pricing options.