PHP Invoice Generator - PHP Class For Beautiful PDF Invoices, it supports HTML Templates also.
PHP Invoice Generator is an object oriented PHP class to generate beautifully designed invoices, quotes or Sale/Purchase orders with just a few lines of code. Brand it with your own logo and theme color, add unlimited items and total rows with automatic paging. You can deliver the PDF output in the user’s browser, save on the server or force a file download.
PHP Invoice Generator is fully customizable and can be integrated into any well known CMS like wordpress, CodeIgniter, Laravel or custom CMS's.
PHP Invoice Generator supports HTML templates based on Mustache Templating. PHP Invoice is a pdf invoicing library based on HTML Templates so you can customize it to max with no special coding.
PHP Invoice Generator has built-in translations in English, Dutch, French, German, Spanish and Italian (you can easily add your own if needed).
PHP Invoice Generator is based on html templating and supports all type of languages and RTL/LTR.
PHP Invoice Generator allows you to add add any currency needed per document.
Additional titles, paragraphs and badges
We made it easy to add extra content (titles and multi-line paragraphs) to the bottom of the document. You might use it for payment or shipping information or any other content needed.
PHP Invoice Generator Examples:
There are 3 examples included in the examples/ folder of this repo:
Create A New Invoice
Make sure that the default php date timezone is set before using the class.
In this simple example we are generating an invoice with custom logo and theme color. It will contain 2 products and a box on the bottom with VAT and total price. Then we add a "Paid" badge right before the output.
$invoice = new phpinvoice();
/* Header Settings */
$invoice-]setLogo("images/sample1.jpg"); //logo image path
$invoice-]setColor("#007fff"); // pdf color scheme
$invoice-]setType("Sale Invoice"); // Invoice Type
$invoice-]setReference("INV-55033645"); // Reference
$invoice-]setDate(date('M dS ,Y',time())); //Billing Date
$invoice-]setTime(date('h:i:s A',time())); //Billing Time
$invoice-]setDue(date('M dS ,Y',strtotime('+3 months'))); // Due Date
$invoice-]setFrom(array("Seller Name","Sample Company Name","128 AA Juanita Ave","Glendora , CA 91740"));
$invoice-]setTo(array("Purchaser Name","Sample Company Name","128 AA Juanita Ave","Glendora , CA 91740"));
/* Adding Items in table */
$invoice-]addItem("AMD Athlon X2DC-7450","2.4GHz/1GB/160GB/SMP-DVD/VB",6,0,580,0,3480);
$invoice-]addItem('LG 18.5" WLCD',"",10,0,230,0,2300);
$invoice-]addItem("HP LaserJet 5200","",1,0,1100,0,1100);
/* Add totals */
/* Set badge */
/* Add title */
/* Add Paragraph */
$invoice-]addParagraph("No item will be replaced or refunded if you don't have the invoice with you.");
/* Set footer note */
$invoice-]setFooternote("My Company Name Here");
/* Render */
/* I =] Display on browser, D =] Force Download, F =] local path save, S =] return document path */
For any assistance or feedback please contact us, we are glad to assist you asap.