PHPackages                             mzur/invoiscript - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. mzur/invoiscript

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

mzur/invoiscript
================

Generate simple PDF invoices

v1.2(1y ago)18351MITPHP

Since Jun 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mzur/InvoiScript)[ Packagist](https://packagist.org/packages/mzur/invoiscript)[ Fund](https://www.paypal.me/drmzur)[ GitHub Sponsors](https://github.com/mzur)[ RSS](/packages/mzur-invoiscript/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

InvoiScript
===========

[](#invoiscript)

Generate simple PDF invoices with PHP.

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

[](#installation)

Run:

```
composer require mzur/invoiscript
```

Usage
-----

[](#usage)

### Example

[](#example)

```
use Mzur\InvoiScript\Invoice;

require_once(__DIR__.'/vendor/autoload.php');

$content = [
   'title' => 'Invoice No. 1',
   'beforeInfo' => [
      'Date:',
      'June 10, 2021',
   ],
   'afterInfo' => [
      'All prices in EUR.',
      '',
      'This invoice is due on June 20, 2021.',
   ],
   'clientAddress' => [
      'Jane Doe',
      'Example Street 42',
      '1337 Demo City',
   ],
   'entries' => [
      [
         'description' => 'Hot air',
         'quantity' => 11,
         'price' => 8,
      ],
      [
         'description' => 'Something cool',
         'quantity' => 5,
         'price' => 20,
      ],
   ],
];

$pdf = new Invoice($content);
$pdf->generate('invoice.pdf');
```

This generates the following PDF:

[![](example/example.png)](example/example.pdf)

### Styling

[](#styling)

Content in `title`, `beforeInfo` and `afterInfo` can be styled with basic HTML-like tags. Example:

```
$content = [
   'title' => 'Invoice No. 1',
   'beforeInfo' => [
      'Date:',
      'June 10, 2021',
   ],
   //...
];
```

Available tags:

- ``: Bold
- ``: Italic
- ``: Underlined

See the [layout section](#layout) for customization of font and font sizes.

### Template

[](#template)

Set a template file:

```
$pdf = new Invoice($content);
$pdf->setTemplate(__DIR__.'/template.pdf');
```

The template can have multiple pages, which will be used for the matching pages of the invoice. If the invoice has more pages than the template, the last page of the template will be repeated.

### Language

[](#language)

Set the language:

```
$pdf = new Invoice($content);
$pdf->setLanguage('de');
```

Available languages are `en` and `de`. Default is `en`.

### Variables

[](#variables)

Variables can be used in `title`, `beforeInfo` and `afterInfo`. Example:

```
$content = [
   'title' => 'Invoice No. {number}',
   'beforeInfo' => [
      'Date:',
      '{createdDate}',
   ],
   //...
];

$variables = [
   'number' => 1,
   'createdDate' => 'June 10, 2021',
];

$pdf = new Invoice($content);
$pdf->setVariables($variables);
```

The following variables are always available:

- `{total}`: Total amount of the invoice.
- `{page}`: Current page number.
- `{pages}`: Total number of pages.

### Layout

[](#layout)

The default spacings, font, font size etc. can be overridden with a custom layout. Example:

```
$layout = [
   'font' => 'helvetica',
];

$pdf = new Invoice($content);
$pdf->setLayout($layout);
```

See the [source code](src/Invoice.php#L357) for all available layout options and the defaults.

Acknowledgment
--------------

[](#acknowledgment)

Thanks to the creator(s) of [FPDF](http://www.fpdf.org/) and [FPDI](https://www.setasign.com/products/fpdi/about/)!

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~328 days

Total

5

Last Release

580d ago

Major Versions

v0.2 → v1.02021-06-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2457311?v=4)[Martin Zurowietz](/maintainers/mzur)[@mzur](https://github.com/mzur)

---

Top Contributors

[![mzur](https://avatars.githubusercontent.com/u/2457311?v=4)](https://github.com/mzur "mzur (14 commits)")[![CommunalWheat9](https://avatars.githubusercontent.com/u/46871372?v=4)](https://github.com/CommunalWheat9 "CommunalWheat9 (1 commits)")

---

Tags

invoiceinvoice-pdfphp

### Embed Badge

![Health badge](/badges/mzur-invoiscript/health.svg)

```
[![Health](https://phpackages.com/badges/mzur-invoiscript/health.svg)](https://phpackages.com/packages/mzur-invoiscript)
```

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k85.8M608](/packages/mpdf-mpdf)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4306.4M37](/packages/horstoeko-zugferd)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[atgp/factur-x

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

154947.6k4](/packages/atgp-factur-x)[myparcelnl/sdk

This package is designed to send and receive data from MyParcel by means of an API.

31536.1k29](/packages/myparcelnl-sdk)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)

PHPackages © 2026

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