PHPackages                             gablem/aftfpdf - 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. gablem/aftfpdf

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

gablem/aftfpdf
==============

aftFPDF is an extended version of the tFPDF library, with added AcroForm support.

v1.1.1(10mo ago)028LGPL-2.1-onlyPHPPHP &gt;=5.1

Since Oct 4Pushed 10mo agoCompare

[ Source](https://github.com/gablem/aftFPDF)[ Packagist](https://packagist.org/packages/gablem/aftfpdf)[ RSS](/packages/gablem-aftfpdf/feed)WikiDiscussions master Synced 1mo ago

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

aftFPDF
=======

[](#aftfpdf)

Description
-----------

[](#description)

aftFPDF is a fork of [tFPDF](https://github.com/Setasign/tFPDF) that introduces additional features, including AcroForm support and transparency. It is designed to be 100% backward compatible with tFPDF, allowing for an effortless, drop-in replacement in existing projects.

Features
--------

[](#features)

- All features from tFPDF including UTF8 support for foreign language characters
- Create AcroForm with text fields, signature fields, checkboxes, and radio buttons.
- Control element transparency using *SetAlpha*.

Requirements
------------

[](#requirements)

- Compatible with PHP up to version 8.3+

Usage
-----

[](#usage)

### Using AcroForm Fields

[](#using-acroform-fields)

#### Adding Checkboxes

[](#adding-checkboxes)

Use the `CheckboxField` function to add checkboxes to your PDF. The `$properties` array can include:

- `value`: Assign a value to differentiate checkboxes. Checkboxes with the same name become mutually exclusive.
- `checked`: Set to `true` to pre-check the checkbox.

```
$pdf->CheckboxField('option1', 20, 140, 5, 5, array('value' => 'A', 'checked' => true));
$pdf->CheckboxField('option1', 20, 150, 5, 5, array('value' => 'B'));
$pdf->CheckboxField('option2', 20, 160, 5, 5, array('checked' => true)); // Independent checkbox
```

#### Adding Text Fields

[](#adding-text-fields)

Use the `TextField` function to add text input fields. The `$properties` array can include:

- `value`: The text displayed inside the field.
- `signature`: Set to `true` to make the field a signature field.
- `multiline`: Set to `true` to allow multiple lines of text.

```
$pdf->TextField('fullname', 'John Doe', 20, 180, 60, 10);
$pdf->TextField('comments', '', 20, 200, 100, 30, array('multiline' => true));
$pdf->TextField('signature', '', 20, 250, 80, 20, array('signature' => true));
```

### Setting Transparency (&gt;=v1.1.0)

[](#setting-transparency-v110)

You can use the `SetAlpha` function to control the transparency of elements in your PDF.

```
require('aftFPDF.php');

$pdf = new aftFPDF();

$pdf->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true);
$pdf->SetFont('DejaVuSans');

$pdf->AddPage();

// Set an alpha value for the rectangle
$pdf->SetAlpha(0.5);
$pdf->Rect(20, 20, 50, 50, 'F');

// Set an 50% alpha value for the fill, but keep 100% for the stroke
$pdf->SetAlpha(0.5, 1);
$pdf->Rect(40, 40, 50, 50, 'DF');

// Also works with text
$pdf->SetFontSize(64);
$pdf->SetAlpha(0.5);
$pdf->SetTextColor(255, 0, 0);
$pdf->Text(45, 62, "Hello World");

$pdf->SetTextColor(0, 0, 255);
$pdf->Text(46, 63, "Hello World");

$pdf->Output('output.pdf', 'F');
```

License
-------

[](#license)

This project is licensed under the **GNU Lesser General Public License v3.0 (LGPL-3.0)**. You are free to use, modify, and distribute this library under the terms of the LGPL-3.0 license.

Support
-------

[](#support)

If you encounter issues or have questions, feel free to contact me at .

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance54

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

Every ~145 days

Recently: every ~43 days

Total

8

Last Release

306d ago

### Community

Maintainers

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

---

Top Contributors

[![gablem](https://avatars.githubusercontent.com/u/1383141?v=4)](https://github.com/gablem "gablem (13 commits)")[![JanSlabon](https://avatars.githubusercontent.com/u/12390057?v=4)](https://github.com/JanSlabon "JanSlabon (13 commits)")[![niels-numbers](https://avatars.githubusercontent.com/u/1765602?v=4)](https://github.com/niels-numbers "niels-numbers (2 commits)")

---

Tags

pdfunicodefpdftfpdfaftfpdf

### Embed Badge

![Health badge](/badges/gablem-aftfpdf/health.svg)

```
[![Health](https://phpackages.com/badges/gablem-aftfpdf/health.svg)](https://phpackages.com/packages/gablem-aftfpdf)
```

###  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.

76863.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)
