dev-master
9999999-devFaktura - HTML/PDF Invoice Generator
MIT
The Requires
- php >=5.4.0
- loskoderos/generic-php dev-master
Faktura - HTML/PDF Invoice Generator
Generate pretty PDF invoices in PHP, (*1)
Faktura in polish means invoice and this library is created to render pretty invoices in PHP., (*2)
Faktura is a simple standalone PHP library for rendering PDF invoices in PHP. You can easily integrate it into your own project using standard tools like composer. Currently, Faktura depends on xvfb and wkhtmltopdf to create PDF files. Faktura has builtin rendering based on native PHP templates that can be customized with plugin functions., (*3)
Sample PDF invoice: https://github.com/loskoderos/faktura-php/blob/master/examples/simple_invoice_pl.pdf
, (*4)
Faktura is simple to use and it lets you to map an invoice structure and customize it to your needs., (*5)
use LosKoderos\Faktura\Faktura; $faktura = new Faktura(); $invoice = $faktura->newInvoice(); $invoice->setInvoiceReference('INV/123/2018'); //... $invoice->newItem() ->setDescription('Some item on the invoice') ->setUnitNetPrice(123) ; //... $faktura->setTemplate('path_to_your_invoice_template.phtml'); $faktura->export($invoice, 'invoice.pdf');
Have a look into examples folder to see the full example: https://github.com/loskoderos/faktura-php/blob/master/examples/simple_invoice_pl.php, (*6)
Faktura is still under development, however if you want to try it out you can easily install it with Composer:, (*7)
composer config minimum-stability dev composer require loskoderos/faktura-php:dev-master
Before you use it, you need to take care of a couple od system dependencies. You'll need to install Xvfb and Wkhtmltopdf, on Ubuntu run:, (*8)
sudo apt-get install xvfb wkhtmltopdf
To confirm, all is good, run the example:, (*9)
php examples/simple_invoice_pl.php
It should finish without any error and generate examples/simple_invoice_pl.pdf., (*10)
Contributions are welcome, please submit a pull request., (*11)
MIT, (*12)
Faktura - HTML/PDF Invoice Generator
MIT