PHPackages                             8ctopus/pigeon-invoice - 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. 8ctopus/pigeon-invoice

ActiveLibrary[Payment Processing](/categories/payments)

8ctopus/pigeon-invoice
======================

Create pdf and html invoices

5.0.3(5mo ago)49441MITPHPPHP &gt;=8.0CI passing

Since May 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/8ctopus/pigeon-invoice)[ Packagist](https://packagist.org/packages/8ctopus/pigeon-invoice)[ Docs](https://github.com/8ctopus/pigeon-invoice)[ RSS](/packages/8ctopus-pigeon-invoice/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (58)Used By (0)

The pigeon invoice
==================

[](#the-pigeon-invoice)

[![packagist](https://camo.githubusercontent.com/d4e8a41a0c85d941337aeba91c5661da7af2fce5a7913ea29105f82c11d8830a/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f706967656f6e2d696e766f6963652f76)](https://packagist.org/packages/8ctopus/pigeon-invoice)[![downloads](https://camo.githubusercontent.com/1ddbcdd54897e1c9bd013702d9bc9a015be9f756277e382fe22d712ac698fb0d/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f706967656f6e2d696e766f6963652f646f776e6c6f616473)](https://packagist.org/packages/8ctopus/pigeon-invoice)[![min php version](https://camo.githubusercontent.com/a934092a0901a13b3d94c3e65729444ab2a0a950b92552a67c242091ed037b78/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f706967656f6e2d696e766f6963652f726571756972652f706870)](https://packagist.org/packages/8ctopus/pigeon-invoice)[![license](https://camo.githubusercontent.com/1b4031758a473e97d77fbf6792c3040eab8b0cc4d553d2625817a7049f31ac32/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f706967656f6e2d696e766f6963652f6c6963656e7365)](https://packagist.org/packages/8ctopus/pigeon-invoice)[![tests](https://github.com/8ctopus/pigeon-invoice/actions/workflows/tests.yml/badge.svg)](https://github.com/8ctopus/pigeon-invoice/actions/workflows/tests.yml)[![code coverage badge](https://raw.githubusercontent.com/8ctopus/pigeon-invoice/image-data/coverage.svg)](https://raw.githubusercontent.com/8ctopus/pigeon-invoice/image-data/coverage.svg)[![lines of code](https://raw.githubusercontent.com/8ctopus/pigeon-invoice/image-data/lines.svg)](https://raw.githubusercontent.com/8ctopus/pigeon-invoice/image-data/lines.svg)

Create pdf invoices

features
--------

[](#features)

- create pdf and html invoices
- fully customizable thanks to `Twig` templates
- localizable (demo shows Arabic, French, German, Greek, Japanese, Korean, Russian and Traditional Chinese)
- extendable to include custom data (see the `extend` dir)
- choice of pdf engines: `Dompdf` using either `CPDF` or `PDFLib` and `wktopdf`
- adjust paper size

[![invoice demo screenshot](screenshot.png)](screenshot.png)

requirements
------------

[](#requirements)

- `php > 8.0` with `ext-dom` and `ext-mbstring` installed

demo
----

[](#demo)

- git clone the project
-

```
composer install
php demo.php
```

- check generated invoices `invoice.pdf` and `invoice.html`

install
-------

[](#install)

- install package

```
composer require 8ctopus/pigeon-invoice
```

- copy the `resources` directory to your project

```
use Oct8pus\Invoice\Company;
use Oct8pus\Invoice\Discount;
use Oct8pus\Invoice\Invoice;
use Oct8pus\Invoice\Item;
use Oct8pus\Invoice\Person;
use Oct8pus\Invoice\Shipping;
use Oct8pus\Invoice\Tax;

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

$invoice = (new Invoice([
    'rootDir' => __DIR__ . DIRECTORY_SEPARATOR . 'resources',
    'templatesDir' => 'templates',
    'locale' => 'en'
]))
    ->setSeller((new Company())
        ->setName('Widgets LLC')
        ->setWebsite('https://www.widgets.ru')
        ->setEmail('hello@widgets.ru')
        ->setStreet1('16 Leo Tolstoy Street')
        ->setZip('119021')
        ->setCity('Moscow')
        ->setCountry('Russia'))

    ->setBuyer((new Person())
        ->setFirstName('Yuri')
        ->setLastName('Kamasov')
        ->setStreet1('Krasnoarmeyskaya 1')
        ->setZip('620026')
        ->setCity('Yekaterinburg')
        ->setCountry('Russia'))

    ->setDate(new DateTime('28-04-2022'))
    ->setNumber('EN43UD6JA7I2LNBC17')
    ->setCurrency('EUR')

    // add items
    ->addItem((new Item())->setName('Item 1')->setPrice(4.99)->setQuantity(1))
    ->addItem((new Item())->setName('Item 2')->setPrice(9.99)->setQuantity(2))
    ->addItem((new Item())->setName('Item 3')->setPrice(3.99)->setQuantity(3))

    ->setDiscount((new Discount())->setName('Special Offer')->setPrice(10.00))

    ->setShipping((new Shipping())->setName('Shipping')->setPrice(5.00))

    ->setTax((new Tax())->setName('VAT')->setPercentage(0.21))

    ->setCustomFields([
        'notes' => 'Thank you for shopping with us!',
    ]);

$html = $invoice->renderHtml();

file_put_contents('invoice.html', $html);

$pdf = $invoice->renderPdf([
    'paper' => 'A4',
    'orientation' => 'portrait',
    // allow to download content from the internet such as fonts
    'isRemoteEnabled' => true,
    // valid options: CPDF, PDFLib, GD, wkhtmltopdf and auto
    'pdfBackend' => 'CPDF',
]);

file_put_contents('invoice.pdf', $pdf);
```

pdf engines
-----------

[](#pdf-engines)

- `Dompdf` includes three engines

    - `CPDF` (bundled with Dompdf)
    - [`PDFLib`](https://www.pdflib.com/) is a commercial library with more advanced rendering than `CPDF`. It takes the form of a php extension that you will need to add to your php configuration.
    - `GD` will produce a pdf containing an image
- `wktopdf`

To use the `wktopdf` engine, you will need to [download the binary](https://wkhtmltopdf.org/downloads.html) for your system and add it to the current working directory `getcwd()` or to the system path.

Twig templates reference documentation
--------------------------------------

[](#twig-templates-reference-documentation)

```
https://twig.symfony.com/doc/3.x/

```

custom fonts
------------

[](#custom-fonts)

Fonts can either be provided as a style sheet link in the html head, which requires the `isRemoteEnabled` permission:

```

```

or from the local drive using css, but only in TrueType `*.ttf` format:

```
@font-face {
    font-family: 'Tangerine';
    src: url('../fonts/tangerine-400.ttf');
    font-weight: normal;
}

@font-face {
    font-family: 'Tangerine';
    src: url('../fonts/tangerine-700.ttf');
    font-weight: bold;
}
```

I would recommend you use the second variant in production.

support more languages
----------------------

[](#support-more-languages)

A font supports a limited number of languages, and therefore if you want to support many different languages, you will need to add fonts that have the glyphs for the language characters. Here's an example where the default font is `Segoe UI` (latin languages), then it falls back to `Meiyro UI` for Japanese, and `Malgun Gothic` for Korean:

```
font-family: 'Segoe UI', 'Meiryo UI', 'Malgun Gothic', sans-serif;
```

If the font does not support the language, you will see small squares instead of the correct characters. These are called `tofu` because they resemble small blocks of tofu.

More info:

credits
-------

[](#credits)

- Dompdf
- CPDF  (used internally by Dompdf)
- wk&lt;html&gt;topdf
- Twig
- logo
- Tangerine font

tests
-----

[](#tests)

```
composer test

```

Note: tests do not check the pdf output, it seems it's not ready yet in [DomPDF](https://github.com/dompdf/dompdf/pull/2510)

clean code
----------

[](#clean-code)

```
composer fix

```

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance71

Regular maintenance activity

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 99.6% 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 ~23 days

Recently: every ~140 days

Total

57

Last Release

164d ago

Major Versions

0.1.4 → 1.0.02022-05-02

1.3.13 → 2.0.02023-09-22

2.0.0 → 3.0.02023-09-25

3.0.1 → 4.0.02023-10-16

4.2.1 → 5.0.02024-05-29

PHP version history (2 changes)1.0.0PHP &gt;=8

1.3.11PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dafd5f7ef8134a5c9b231686c5da3d6416db09139b45aac0b26952178dffb8a?d=identicon)[8ctopus](/maintainers/8ctopus)

---

Top Contributors

[![8ctopus](https://avatars.githubusercontent.com/u/13252042?v=4)](https://github.com/8ctopus "8ctopus (249 commits)")[![andyfitch](https://avatars.githubusercontent.com/u/265406?v=4)](https://github.com/andyfitch "andyfitch (1 commits)")

---

Tags

invoicepdf-generationphppdfhtmlinvoice

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/8ctopus-pigeon-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/8ctopus-pigeon-invoice/health.svg)](https://phpackages.com/packages/8ctopus-pigeon-invoice)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[atgp/factur-x

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

138825.5k3](/packages/atgp-factur-x)[anam/phantommagick

PhantomMagick provides a simple API to ease the process of converting HTML to PDF or images

161456.4k2](/packages/anam-phantommagick)[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)[torgodly/html2media

Html2Media is a versatile Laravel package that allows users to convert HTML content into high-quality PDFs with options for either downloading or triggering a print dialog. Ideal for generating documents, invoices, and reports, this package includes configurable settings for file name, page orientation, format, margins, and scale. Html2Media also provides seamless integration with Filament actions, enabling dynamic content rendering in modals and customizable output previews. Whether you need to save a PDF or send it directly to the printer, Html2Media simplifies the process with robust, flexible features.

4532.5k1](/packages/torgodly-html2media)

PHPackages © 2026

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