PHPackages                             loskoderos/faktura-php - 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. loskoderos/faktura-php

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

loskoderos/faktura-php
======================

Generate pretty PDF invoices in PHP

113404PHP

Since Dec 21Pushed 3y ago2 watchersCompare

[ Source](https://github.com/loskoderos/faktura-php)[ Packagist](https://packagist.org/packages/loskoderos/faktura-php)[ RSS](/packages/loskoderos-faktura-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Faktura PHP
===========

[](#faktura-php)

Generate pretty PDF invoices in PHP

What is this?
-------------

[](#what-is-this)

Faktura in polish means invoice and this library is created to render pretty invoices in PHP.

Faktura is a simple standalone PHP library for rendering PDF invoices in PHP. You can easily integrate it into your own project using standard tools like composer. Currently, Faktura depends on *xvfb* and *wkhtmltopdf* to create PDF files. Faktura has builtin rendering based on native PHP templates that can be customized with plugin functions.

Sample PDF invoice: [https://github.com/loskoderos/faktura-php/blob/master/examples/simple\_invoice\_pl.pdf](https://github.com/loskoderos/faktura-php/blob/master/examples/simple_invoice_pl.pdf)[![sample](https://raw.githubusercontent.com/loskoderos/faktura-php/master/examples/screenshot1.png)](https://raw.githubusercontent.com/loskoderos/faktura-php/master/examples/screenshot1.png)

Basic usage
-----------

[](#basic-usage)

Faktura is simple to use and it lets you to map an invoice structure and customize it to your needs.

```
use LosKoderos\Faktura\Faktura;

$faktura = new Faktura();

$invoice = $faktura->newInvoice();
$invoice->setInvoiceReference('INV/123/2018');

//...

$invoice->newItem()
    ->setDescription('Some item on the invoice')
    ->setUnitNetPrice(123)
    ;

//...

$faktura->setTemplate('path_to_your_invoice_template.phtml');
$faktura->export($invoice, 'invoice.pdf');
```

Have a look into *examples* folder to see the full example: [https://github.com/loskoderos/faktura-php/blob/master/examples/simple\_invoice\_pl.php](https://github.com/loskoderos/faktura-php/blob/master/examples/simple_invoice_pl.php)

Features
--------

[](#features)

- Standalone library, no external PHP frameworks needed.
- Easily integrates with others.
- Builtin templating using native PHP templates.
- Builtin support for UTF-8 and images.
- Extend template rendering with custom plugin functions.
- Invoice structure can be customized, you can add custom fields to fit your needs.
- Invoice can be serialized to save it in database for accounting purposes.
- You can easily customize the library with overrides.

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

[](#installation)

Faktura is still under development, however if you want to try it out you can easily install it with Composer:

```
composer config minimum-stability dev
composer require loskoderos/faktura-php:dev-master

```

Before you use it, you need to take care of a couple od system dependencies. You'll need to install Xvfb and Wkhtmltopdf, on Ubuntu run:

```
sudo apt-get install xvfb wkhtmltopdf

```

To confirm, all is good, run the example:

```
php examples/simple_invoice_pl.php

```

It should finish without any error and generate *examples/simple\_invoice\_pl.pdf*.

Contributing
------------

[](#contributing)

Contributions are welcome, please submit a pull request.

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0882344b295bdd430ed05752e6b657abb9ecdfd94e01d87f991eb8429a5b88bb?d=identicon)[loskoderos](/maintainers/loskoderos)

---

Top Contributors

[![cepa](https://avatars.githubusercontent.com/u/425351?v=4)](https://github.com/cepa "cepa (32 commits)")

### Embed Badge

![Health badge](/badges/loskoderos-faktura-php/health.svg)

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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