PHPackages                             acucchieri/tcpdf-bundle - 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. acucchieri/tcpdf-bundle

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

acucchieri/tcpdf-bundle
=======================

Integration of the tcpdf library with Symfony

5.0.1(8mo ago)1753↓33.3%MITPHPPHP &gt;=8.1

Since Jul 8Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/acucchieri/ACTcpdfBundle)[ Packagist](https://packagist.org/packages/acucchieri/tcpdf-bundle)[ Docs](https://github.com/acucchieri/ACTcpdfBundle)[ RSS](/packages/acucchieri-tcpdf-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (16)Used By (0)

ACTcpdfBundle
=============

[](#actcpdfbundle)

The `ACTcpdfBundle` integrates the [TCPDF](https://github.com/tecnickcom/TCPDF) PHP library with Symfony. This means easy-to-implement and easy-to-ouptput PDF documents in your Symfony application.

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

[](#installation)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require acucchieri/tcpdf-bundle

```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new AC\TcpdfBundle\ACTcpdfBundle(),
        ];

        // ...
    }
}
```

Usage
-----

[](#usage)

Use `AC\TcpdfBundle\Pdf\PdfBuider` to create your PDF document. This class extends TCPDF, see [TCPDF documentation](https://tcpdf.org) for more informations about PDF generation.

### PDF Output

[](#pdf-output)

`ACTcpdfBundle` provide helpers to serve your PDF

#### Display the PDF in the browser

[](#display-the-pdf-in-the-browser)

Return a Response with `Content-Disposition: inline`

```
$myPdf->inline('my-pdf.doc');
```

#### Download the PDF

[](#download-the-pdf)

Return a Response with `Content-Disposition: attachment`

```
$myPdf->download('my-pdf.doc');
```

#### Get the PDF as base64 mime multi-part email attachment (RFC 2045)

[](#get-the-pdf-as-base64-mime-multi-part-email-attachment-rfc-2045)

```
$myPdf->attachment('my-pdf.doc');
```

#### Save the PDF on a filesystem

[](#save-the-pdf-on-a-filesystem)

```
$myPdf->save('/path/to/my-pdf.doc');
```

#### Output the PDF as string

[](#output-the-pdf-as-string)

```
$myPdf->toString();
```

### MultiCell Helper

[](#multicell-helper)

`AC\TcpdfBundle\Pdf\PdfBuilder::addMultiCellRow($cells, $sameHeight, $nobr)` allow you to build complex tables, based on `MultiCell`.

`$cells` is a multidimensional array. Each cell (array) contains :

- The data (text or html)
- The options. Available options :
- `height` Cell height
- `width` Cell width
- `border` Draw the cell borders. Allowed values : 0 or 1. Default = 0
- `align` Horz alignment. Allowed values : 'L' (left), 'C' (center), 'R' (right) or 'J' (justify). Default = 'T'
- `valign` Vert alignment. Allowed values 'T' (top), 'M' (middle) or 'B' (bottom). Default = 'T'
- `fill` Indicates if the cell background must be painted. true or false. Default = false
- `is_html` Indicate if the data is html. See TCDPF doc for the supported tags. Default = false

`$sameHeight` If set to `true` all the row cells have the same height. Default = false.

`$nobr` If set to `true` the row is not break across 2 pages. Default = false.

Example

```
$data = [
  ['foo' => 'AAA', 'bar' => 123, 'baz' => 'text'],
  ['foo' => 'BBB', 'bar' => 456, 'baz' => 'link'],
  ['foo' => 'CCC', 'bar' => 789, 'baz' => 'line 1line 2'],
];

foreach ($data as $row) {
    $pdf->addRowCell([
      [$row['foo'], ['with' => 30]],
      [$row['bar'], ['width' => 40, 'align' => 'R']],
      [$row['baz'], ['width' => 50, 'is_html' => true]],
    ]);
}
```

License
-------

[](#license)

This bundle is under the MIT license. See the complete license [in the bundle](LICENSE)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 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.

###  Release Activity

Cadence

Every ~249 days

Recently: every ~371 days

Total

13

Last Release

244d ago

Major Versions

v1.2.1 → v2.1.22021-06-23

v2.1.2 → 3.0.02021-08-19

v3.x-dev → 4.0.02024-03-21

v4.x-dev → 5.0.02025-06-03

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.3

v1.1.1PHP &gt;=5.3.9

4.0.0PHP &gt;=7.4

5.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/728819?v=4)[acucchieri](/maintainers/acucchieri)[@acucchieri](https://github.com/acucchieri)

---

Top Contributors

[![acucchieri](https://avatars.githubusercontent.com/u/728819?v=4)](https://github.com/acucchieri "acucchieri (18 commits)")

---

Tags

pdfphpsymfonytcpdfsymfonypdfTCPDF

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/acucchieri-tcpdf-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/acucchieri-tcpdf-bundle/health.svg)](https://phpackages.com/packages/acucchieri-tcpdf-bundle)
```

###  Alternatives

[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[ensepar/html2pdf-bundle

Use HTML2PDF as a Symfony Service

27669.3k](/packages/ensepar-html2pdf-bundle)[qipsius/tcpdf-bundle

A bundle to easily integrate TCPDF into Symfony

22709.1k](/packages/qipsius-tcpdf-bundle)[nucleos/dompdf-bundle

This bundle provides a wrapper for using dompdf inside symfony.

54882.8k1](/packages/nucleos-dompdf-bundle)[propa/tcpdi

TCPDI is a PHP class for importing PDF to use with TCPDF

231.1M1](/packages/propa-tcpdi)

PHPackages © 2026

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