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 enable it in your php.ini:
extension=oicana - Verify it's 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 dependency oicana is licensed under PolyForm Noncommercial License 1.0.0.