PHPackages                             cbaudry/fpdf-utf8 - 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. cbaudry/fpdf-utf8

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

cbaudry/fpdf-utf8
=================

tfpdf

V3.0(1y ago)01LGPL-3.0-or-laterPHPPHP &gt;= 8.0

Since Apr 22Pushed 11mo agoCompare

[ Source](https://github.com/CBaudry/fpdf-utf8)[ Packagist](https://packagist.org/packages/cbaudry/fpdf-utf8)[ Docs](http://github.com/CBaudry/tfpdf)[ RSS](/packages/cbaudry-fpdf-utf8/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

FPDF-UTF8 library
=================

[](#fpdf-utf8-library)

This is an unofficial repository for the [FPDF-library](http://fpdf.org/fr/script/script92.php).
The purpose is to be able to build automatic packages using [composer](http://packagist.org).

Install
-------

[](#install)

You can install this library by editing (or creating) your `composer.json`:

```
{
	"require": {
		"cbaudry/fpdf-utf8": "*"
	}
}

```

And run `composer update` or `composer install`.

Or you can simply run the `composer` command, `composer require cbaudry/fpdf-utf8`.

Usage
-----

[](#usage)

### Namespacing

[](#namespacing)

The namespacing has been changed to `CS\FPDF`.

### Caching

[](#caching)

In this version you can set the cache folder yourself, so it will not put the cache files into the same directory as the font-files. Please note that if you do not set the cache folder, no caching is used and documents may be created a little bit slower.

```
use CS\FPDF\PDF;

$fpdf = new PDF();
$fpdf->setFontPath('/font/unifont/');
$fpdf->setCache('/cache/');
$fpdf->AddPage();
$fpdf->AddFont('OpenSans');
$fpdf->SetFont('OpenSans');
$fpdf->Write('This is a test PDF with OpenSans as font');
$fpdf->Output();

```

### Exception

[](#exception)

A custom exception class `FPDFException` has been created. For all exception error codes, please take a look at the `src/FPDF/Exception/FPDFException.php` file.

About
-----

[](#about)

### What is FPDF-UTF8?

[](#what-is-fpdf-utf8)

FPDF-UTF8 is a version of FPDF, which supports UTF-8 and font-subsetting.
This is a updated version (fork) of [FaimMedia's version](https://github.com/FaimMedia/fpdf-utf8), which is an updated version (fork) of [tFPDF](https://github.com/DocnetUK/tFPDF).

### What is FPDF?

[](#what-is-fpdf)

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

FPDF has other advantages: high level functions. Here is a list of its main features:

- Choice of measure unit, page format and margins
- Page header and footer management
- Automatic page break
- Automatic line break and text justification
- Image support (JPEG, PNG, GIF and WebP)
- Colors
- Links
- TrueType, Type1 and encoding support
- Page compression
- EAN 13, 128 and Code 39 support (without extending the main class)
- PDF Encryption (without extending the main class)
- File Attachment
- Add [XMP data](https://www.adobe.com/products/xmp.html)

FPDF requires no extension, except zlib (to activate compression and handle png alpha chanel) and GD (for GIF support). It works and will be maintained with PHP 8 and above.

The tutorials will give you a quick start. The complete online documentation is here and download area is there. It is strongly advised to read the FAQ which lists the most common questions and issues.

A script section is available and provides some useful extensions (such as bookmarks, rotations, tables, barcodes...).

### What languages can I use?

[](#what-languages-can-i-use)

The class can produce documents in many languages other than the Western European ones: Central European, Cyrillic, Greek, Baltic and Thai, provided you own TrueType or Type1 fonts with the desired character set. Chinese, Japanese and Korean are supported too. UTF-8 support is also available.

### What about performance?

[](#what-about-performance)

Of course, the generation speed of the document is less than with PDFlib. However, the performance penalty keeps very reasonable and suits in most cases, unless your documents are particularly complex or heavy.

Source attribution
------------------

[](#source-attribution)

The Code 128 and Code 39 barcode library code was taken directly from the FPDF website, where source attribution is vague at best, but mostly non-existent. If you need source attribution applying for your code included here, please raise an issue.

Based on [FPDF's Website](http://fpdf.org/) :

- EAN 128 has been shared by Roland Gautier ()
- EAN 13 has been shared by Olivier ()
- Code 39 has been shared by Emmanuel Havet ()
- The base of this library has been release by Ian Back () under the LGPL licence
- File Attachment has been shared by Olivier () and modified to be directly integrated within FPDF

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance52

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f758f97c7fe4291b518a575ceff552a96121c1188692900a5710a70ad2bbf37a?d=identicon)[cbaudry](/maintainers/cbaudry)

---

Top Contributors

[![FaimMedia](https://avatars.githubusercontent.com/u/11771199?v=4)](https://github.com/FaimMedia "FaimMedia (54 commits)")[![CBaudry](https://avatars.githubusercontent.com/u/117809854?v=4)](https://github.com/CBaudry "CBaudry (33 commits)")[![rev42](https://avatars.githubusercontent.com/u/681069?v=4)](https://github.com/rev42 "rev42 (10 commits)")[![kazsaj](https://avatars.githubusercontent.com/u/5666877?v=4)](https://github.com/kazsaj "kazsaj (10 commits)")[![dblencowe](https://avatars.githubusercontent.com/u/88084?v=4)](https://github.com/dblencowe "dblencowe (7 commits)")[![cdburgess](https://avatars.githubusercontent.com/u/216284?v=4)](https://github.com/cdburgess "cdburgess (2 commits)")[![slokhorst](https://avatars.githubusercontent.com/u/8083666?v=4)](https://github.com/slokhorst "slokhorst (1 commits)")[![hultberg](https://avatars.githubusercontent.com/u/1257913?v=4)](https://github.com/hultberg "hultberg (1 commits)")[![rserale](https://avatars.githubusercontent.com/u/8452531?v=4)](https://github.com/rserale "rserale (1 commits)")

---

Tags

pdfutf-8fpdf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cbaudry-fpdf-utf8/health.svg)

```
[![Health](https://phpackages.com/badges/cbaudry-fpdf-utf8/health.svg)](https://phpackages.com/packages/cbaudry-fpdf-utf8)
```

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M488](/packages/mpdf-mpdf)[setasign/fpdi

FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.

1.2k142.4M231](/packages/setasign-fpdi)[setasign/fpdf

FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

77263.8M227](/packages/setasign-fpdf)[setasign/tfpdf

This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.

426.1M30](/packages/setasign-tfpdf)[tmw/fpdm

PDF form filling using FPDM Class written by FPDF author Olivier

129623.6k3](/packages/tmw-fpdm)[fpdf/fpdf

FPDF Composer Wrapper

512.7M21](/packages/fpdf-fpdf)

PHPackages © 2026

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