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 4d ago

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

33

—

LowBetter than 75% of packages

Maintenance41

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

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

487d 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.7k77.1M493](/packages/mpdf-mpdf)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

1422.6M2](/packages/webklex-laravel-pdfmerger)[jurosh/pdf-merge

PHP PDF Merger

1522.2M5](/packages/jurosh-pdf-merge)[creagia/laravel-sign-pad

Laravel package for of E-Signature with Signature Pad and Digital Certified Sign with TCPDF

54097.2k](/packages/creagia-laravel-sign-pad)[setasign/fpdi-protection

A FPDI compatible version of the FPDF\_Protection script.

324.3M2](/packages/setasign-fpdi-protection)[binarystash/pdf-watermarker

Watermark or stamp PDF documents

8260.6k](/packages/binarystash-pdf-watermarker)

PHPackages © 2026

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