PHPackages                             david-garcia/fpdf - 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. david-garcia/fpdf

Abandoned → [setasign/fpdi](/?search=setasign%2Ffpdi)ArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

david-garcia/fpdf
=================

FPDF library which allows to generate PDF files with pure PHP

1.2.0(8y ago)0109MITPHPPHP &gt;=5.5,&lt;7.2

Since Dec 8Pushed 8y ago2 watchersCompare

[ Source](https://github.com/DavidGarciaCat/fpdf)[ Packagist](https://packagist.org/packages/david-garcia/fpdf)[ Docs](https://github.com/DavidGarciaCat/fpdf)[ RSS](/packages/david-garcia-fpdf/feed)WikiDiscussions master Synced today

READMEChangelog (7)DependenciesVersions (9)Used By (0)

FPDF
====

[](#fpdf)

Set-up the library
------------------

[](#set-up-the-library)

### Before we start

[](#before-we-start)

You will need to download and install `composer`:

(NOTE: this project is not related with `composer` team so they can change the way to download and use it. Please refer to [getcomposer.org](https://getcomposer.org/download/) to get latest updates about how to get `composer`)

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

Now that you have the `composer.phar` file, you can move it to your project folder, in order to use it as part of it:

```
mv composer.phar /path/to/your/project/root/composer.phar

php composer.phar -V
```

(NOTE: your `composer.phar` file should be added into your `.gitignore` file, due it's not a file related with your project)

Or you can move it as a global system binary (the how-to-install process is based on this method):

```
mv composer.phar /usr/bin/composer

composer -V
```

### Install

[](#install)

Just include your package in your `composer.json` file:

```
{
    "require": {
        "david-garcia/fpdf": "^1.1"
    }
}
```

Then run the `composer` command to install the dependency:

```
composer install
```

Alternatively you can just `require` the package to deal with all of it automatically:

```
composer require david-garcia/fpdf
```

### Usage

[](#usage)

Step 1. Include the composer autoload:

```
require "vendor/autoload.php";
```

Step 2. Include the `use` statements for `FPDF`:

```
use DavidGarciaCat\FPDF\FPDF;
```

Step 3. Create a PDF file:

```
$fpdf = new new FPDF();
$fpdf->output();
```

### Scripts

[](#scripts)

FPDF allows to build and implement stripts to expand and enhance the experience working with the library.

This project is implementing the currently published Scripts in FPDF website as Design Pattern Decorators. Just set-up the main library as a Facade and then inject it in any Decorator constructor:

```
use DavidGarciaCat\FPDF\FPDF;
use DavidGarciaCat\FPDF\Script\BookmarkDecorator;

$fpdf = new BookmarkDecorator(new FPDF());
```

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 and GIF)
- Colors
- Links
- TrueType, Type1 and encoding support
- Page compression

FPDF requires no extension (except Zlib to enable compression and GD for GIF support). The latest version requires at least PHP 5.1, however this project is based on PHP 5.5 or newer versions.

Please browse [www.fpdf.org](http://www.fpdf.org/) for Tutorials and Documentation. The tutorials will give you a quick start. The complete online documentation is available OnLine and you can downlaod it in multiple languages. 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...).

ToDo
----

[](#todo)

- **Provide all FPDF Scripts natively**
    FPDF has several scripts, but we need to download and include all of them manually, in order to use them. This project already moved the FPDF code to `namespaces` and is starting to include other FPDF Scripts, however the real goal is to include all these functionalities natively, as part of the project.
- **Scrutinizer CI Code coverage**
    Base FPDF source code, downloadable at [www.fpdf.org](http://www.fpdf.org/)'s website, does not include automated tests, so there's no code coverage. This project wants to provide tests, in order to enhance the code quality and offer the expected warranties that all of us want for a project like this.
- **Scrutinizer CI Code score**
    Base FPDF and FPDF Scripts are probably not designed in the right way, and code score is really poor due a high complexity and some missed checks. This project wants to improvide the code quality.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~0 days

Total

7

Last Release

3073d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62c1db3c19dedf826fe3b41a2fa2df2cc65ec69bd0f388b9854c624e85af5fa4?d=identicon)[DavidGarciaCat](/maintainers/DavidGarciaCat)

---

Top Contributors

[![DavidGarciaCat](https://avatars.githubusercontent.com/u/7809429?v=4)](https://github.com/DavidGarciaCat "DavidGarciaCat (71 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

pdffpdf

### Embed Badge

![Health badge](/badges/david-garcia-fpdf/health.svg)

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

###  Alternatives

[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.7M22](/packages/fpdf-fpdf)[setasign/fpdi-protection

A FPDI compatible version of the FPDF\_Protection script.

324.3M2](/packages/setasign-fpdi-protection)

PHPackages © 2026

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