PHPackages                             millieofzo/php-invoicer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. millieofzo/php-invoicer

ActiveLibrary[Payment Processing](/categories/payments)

millieofzo/php-invoicer
=======================

Library to generate PDF invoices with PHP

v1.1.0(7y ago)44.7k↓36.1%2MITPHPPHP &gt;=5.6

Since May 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MillieOfzo/PHP-invoicer)[ Packagist](https://packagist.org/packages/millieofzo/php-invoicer)[ RSS](/packages/millieofzo-php-invoicer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

[![Travis Build Status](https://camo.githubusercontent.com/0bee34b7cc1d6cffa0ad3ec080999eb47006ec9bab5c0e41b5cc359239ad4caa/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d696c6c69656f667a6f2f7068702d696e766f696365722e737667)](https://travis-ci.org/millieofzo/php-invoicer)[![Latest Stable Version](https://camo.githubusercontent.com/f32f532d5a4b5a41d12416e6fc0c7efbcdf4990c14e698076e8614354159995f/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c69656f667a6f2f7068702d696e766f696365722f762f737461626c65)](https://packagist.org/packages/millieofzo/php-invoicer)[![Total Downloads](https://camo.githubusercontent.com/9f3d4d1f72c54ec7fcc8fc03f8987e072d14e55e4973de1d873c2bea08fc1102/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c69656f667a6f2f7068702d696e766f696365722f646f776e6c6f616473)](https://packagist.org/packages/millieofzo/php-invoicer)[![Latest Unstable Version](https://camo.githubusercontent.com/f608deb74d8536891089e0dc0fec49fe33263313a1e9f06e51d541e21c264b34/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c69656f667a6f2f7068702d696e766f696365722f762f756e737461626c65)](https://packagist.org/packages/millieofzo/php-invoicer)[![License](https://camo.githubusercontent.com/3237a446484e05848cd040e8cff9fc3322aa21d11c5f3c186f24ff7ccf8b7b73/68747470733a2f2f706f7365722e707567782e6f72672f6d696c6c69656f667a6f2f7068702d696e766f696365722f6c6963656e7365)](https://packagist.org/packages/millieofzo/php-invoicer)

PHP Invoicer
============

[](#php-invoicer)

Features:

- PHP 7.2 Support
- PSR-4 compatible
- Available as composer package
- Dependencies are coming via composer

Introduction
------------

[](#introduction)

PHP Invoicer is a simple object oriented PHP class to generate beautifully designed invoices, quotes or 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 ouput in the user's browser, save on the server or force a file download. PHP Invoicer is fully customizable and can be integrated into any well known CMS.

### Multi-languages &amp; Currencies

[](#multi-languages--currencies)

PHP Invoicer has built in translations in:

- English
- Dutch
- French
- German
- Spanish
- Italian
- Portugese

You can easily add your own if needed and you can set the currency needed per document.

### Additional Titles, Paragraphs And Badges

[](#additional-titles-paragraphs-and-badges)

Extra content (titles and multi-line paragraphs) can be added to the bottom of the document. You might use it for payment or shipping information or any other content needed.

```
/* Set badge */
$invoice->addBadge("Payment Paid");

/* Add title */
$invoice->addTitle("Important Notice");

/* Add Paragraph */
$invoice->addParagraph("No item will be replaced or refunded if you don't have the invoice with you. You can refund within 2 days of purchase.");

/* Set footer note */
$invoice->setFooternote("My Company Name Here");
```

Installation
------------

[](#installation)

```
composer require millieofzo/php-invoicer
```

Examples
--------

[](#examples)

There are 3 examples included in the `examples/` folder of this repo:

- simple.php
- example1.php
- invoice.php

### Create A New Invoice

[](#create-a-new-invoice)

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 21% and total price. Then we add a "Paid" badge right before the output.

```
use MillieOfzo\PHPInvoicer\PHPInvoicer;

    $invoice = new PHPInvoicer('','€','en');

    /* Header Settings */
    $invoice->setLogo("../examples/images/ti_logo_yellow.png");
    $invoice->setColor("#4d4c59");
    $invoice->setType("Simple Invoice");
    $invoice->setOrderid("2018052100012");
    $invoice->setReference("55033645");
    $invoice->setDate(date('d-m-Y',time()));
    $invoice->setDue(date('d-m-Y',strtotime('+3 months')));
    $invoice->hide_tofrom();

    /* Adding Items in table */
    $invoice->addItem("AMD Athlon X2DC-7450","2.4GHz/1GB/160GB/SMP-DVD/VB",2,2);
    $invoice->addItem("PDC-E5300","2.6GHz/1GB/320GB/SMP-DVD/FDD/VB",4,645);

      /* Add totals */
    $invoice->addSubTotal();
    $invoice->addVatTotal(21);
    $invoice->addTotal(true);

    /* Set badge */
    $invoice->addBadge("Payment Paid");

    /* Render */
    /* I => Display on browser, D => Force Download, F => local path save, S => return document path */
    $invoice->render('example2.pdf','I');
```

Documentation
-------------

[](#documentation)

### Create Instances

[](#create-instances)

```
use MillieOfzo\PHPInvoicer\PHPInvoicer;

// Default Param: Size: A4, Currency: $, Language: en
$invoice = new PHPInvoicer($size, $currency, $language);
```

ParameterTypeAcceptsNotesizestringA4 (default)
Letter
LegalSet your document sizecurrencystringany string (e.g. "$", "£", "€")Set the currency that you want to uselanguagestringen (default), nl, fr, de, es, itA language that exists in the `inc/languages` folder### Number Formatting

[](#number-formatting)

How do you want to show your numbers?

```
$invoice->setNumberFormat($decimalpoint, $seperator);
```

ParameterTypeAcceptsNotedecimalpointstringCommonly used is '.' or ','What string to use for decimal pointseperatorstringCommonly used is '.' or ','What string to use for thousands separator### Color

[](#color)

Set a custom color to personalize your invoices.

```
// Hexadecimal color code
$invoice->setColor($color);
```

### Add Logo

[](#add-logo)

```
$invoice->setLogo($image, $maxwidth, $maxheight);
```

ParameterTypeAcceptsNoteimagestringLocal path or remote url of the imagePreferably a good quality transparant png imagemaxwidth (optional)intThe width (in mm) of the bounding box where the image will be fitted inmaxheight (optional)intThe height (in mm) of the bounding box where the image will be fitted inDocument Title
--------------

[](#document-title)

```
// A string with the document title, will be displayed
// in the right top corner of the document (e.g. 'Invoice' or 'Quote')
$invoice->setType($title);
```

### Document order ID

[](#document-order-id)

```
// Set order ID of document that will be displayed in
// the right top corner of the document (e.g. '2018052100012')
$invoice->setOrderid($orderid);
```

### Invoice Number

[](#invoice-number)

```
// Document reference number that will be displayed in
// the right top corner of the document (e.g. 'INV29782')
$invoice->setReference($number);
```

### Date

[](#date)

```
//A string with the document's date
$invoice->setDate($date);
```

### Due Date

[](#due-date)

```
// A string with the document's due date
$invoice->setDue($duedate);
// Example
$invoice->setDue(date('d-m-Y',strtotime('+3 months')));
```

### Issuer Information

[](#issuer-information)

Set your company details. An array with your company details. The first value of the array will be bold on the document so it's suggested to use your company's name. You can add as many lines as you need.

```
/** Example: */
$invoice->setFrom([
    'My Company',
    'Address line 1',
    'Address line 2',
    'City and zip',
    'Country',
    'VAT number',
    'test'
]);
```

### Client Information

[](#client-information)

An array with your clients' details. The first value of the array will be bold on the document so we suggest you to use the company's name. You can add as many lines as you need.

Note: Keep the array count of Issuer and Client the same. Use empty value if necessary

```
/** Example */
$invoice->setTo([
   'My Client',
   'Address line 1',
   'Address line 2',
   'City and zip',
   'Country',
   'VAT number',
   '' //Note keep count the same as issuer
]);
```

### Flip Flop

[](#flip-flop)

Switch the horizontal positions of your company information and the client information. By default, your company details are on the left.

```
$invoice->flipflop();
```

### Adding Items

[](#adding-items)

Add a new product or service row to your document below the company and client information. PHP Invoice has automatic paging so there is absolutely no limit.

```
// $vat and $discount are optional
$invoice->addItem($name,$description,$quantity,$price,$vat = false,$discount = false);
```

ParameterTypeAcceptsNotenamestringA string with the product or service name.descriptionstringA string with the description with multi-line support. Use either
 or \\n to add a line-break.quantityintSpecify the amount of the productpriceinte.g 826The price of the productvatinte.g 21, 8Optional. Specify a vat percentage, which will calculate a 21% value from subtotaldiscountinte.g 10, 15, 20Optional. Specify a discount percentage, which will calculate a 10% discount on the subtotal### Adding Subtotal

[](#adding-subtotal)

Add a row below the products showing the calculated combined price amount of all products

```
$invoice->addSubTotal();
```

### Adding Discount

[](#adding-discount)

Add a row below the products showing the calculated discount price. Specify the discount amount as a integer e.g 10.

```
$invoice->addDiscountTotal($percent);
```

### Adding VAT

[](#adding-vat)

Add a row below the products showing the calculated VAT amount. VAT is calculated after discount. Specify the VAT amount as a integer e.g 21.

```
$invoice->addVatTotal($percent);
```

### Adding Total

[](#adding-total)

Add a row below the products and services with the total amount. Includes VAT amount and any discount amout

```
$invoice->addTotal($colored);
```

### Adding Row

[](#adding-row)

Add a row below the products and services for calculations and totals. You can add unlimited rows.

```
$invoice->addRow($name,$value,$colored);
```

- $name {string} A string for the display name of the total
- $value {decimal} A decimal for the value.
- $colored {boolean} Optional Set to true to set the theme color as background color of the row.

### Adding A Badge

[](#adding-a-badge)

Adds a badge to your invoice below the products and services. You can use this for example to display that the invoice has been payed.

```
$invoice->addBadge($badge, $color);
```

- $badge {string} A string with the text of the badge.
- $color {string} Optional. A string with the hex code of the color.

### Add Title

[](#add-title)

You can add titles and paragraphs to display information on the bottom part of your document such as payment details or shipping information.

```
$invoice->addTitle($title);
```

- $title {string} A string with the title to display in the badge.

### Add Paragraph

[](#add-paragraph)

You can add titles and paragraphs to display information on the bottom part of your document such as payment details or shipping information.

```
$invoice->addParagraph($paragraph);
```

- $Paragraph {string} A string with the paragraph text with multi-line support. Use either
     or \\n to add a line-break.

### Footer

[](#footer)

A small text you want to display on the bottom left corner of the document.

```
$invoice->setFooternote($note);
```

- $note {string} A string with the information you want to display in the footer.

### Rendering The Invoice

[](#rendering-the-invoice)

```
$invoice->render($name, $output);
// Example:
// $invoice->render('invoice.pdf', 'S')
```

- $name {string} A string with the name of your invoice.
- $output {string} Choose how you want the invoice to be delivered to the user.

The following options are available:

- I (Send the file inline to the browser)
- D (Send to the browser and force a file download with the name given by name)
- F (Save to a local file. Make sure to set pass the path in the name parameter)
- S (Return the document as a string)

Credits
-------

[](#credits)

- [Splashpk](https://github.com/farjadtahir/pdf-invoicr)
- [FPDF](http://www.fpdf.org/)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2910d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/149c041d08ff8778bab328ec182523397d1e77298a0b89bf3f69b03023805700?d=identicon)[MillieOfzo](/maintainers/MillieOfzo)

---

Top Contributors

[![MillieOfzo](https://avatars.githubusercontent.com/u/8093544?v=4)](https://github.com/MillieOfzo "MillieOfzo (35 commits)")

---

Tags

phppdfinvoiceMillieOfzo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/millieofzo-php-invoicer/health.svg)

```
[![Health](https://phpackages.com/badges/millieofzo-php-invoicer/health.svg)](https://phpackages.com/packages/millieofzo-php-invoicer)
```

###  Alternatives

[atgp/factur-x

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files

138825.5k3](/packages/atgp-factur-x)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4044.3M18](/packages/horstoeko-zugferd)[konekt/pdf-invoice

Library to generate PDF invoices

212200.7k](/packages/konekt-pdf-invoice)[phpcfdi/cfditopdf

Create a generic PDF file from a CFDI 3.3 &amp; 4.0 (CLI included)

4144.3k4](/packages/phpcfdi-cfditopdf)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
