PHPackages                             j-barnes/tcpdi - 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. j-barnes/tcpdi

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

j-barnes/tcpdi
==============

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

013PHP

Since Jul 28Pushed 3y agoCompare

[ Source](https://github.com/j-barnes/tcpdi)[ Packagist](https://packagist.org/packages/j-barnes/tcpdi)[ RSS](/packages/j-barnes-tcpdi/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TCPDI
=====

[](#tcpdi)

**Compatible with PHP 8.**

Composer ready [TCPDI](https://github.com/pauln/tcpdi).

PDF importer for [TCPDF](http://www.tcpdf.org/), based on [FPDI](http://www.setasign.de/products/pdf-php-solutions/fpdi/). Requires [pauln/tcpdi\_parser](https://github.com/pauln/tcpdi_parser) and [FPDF\_TPL](http://www.setasign.de/products/pdf-php-solutions/fpdi/downloads/)which is included in the repository.

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

[](#installation)

Link package in composer.json, e.g.

```
{
    "require": {
        "j-barnes/tcpdi": "^1.0"
    }
}
```

Usage
-----

[](#usage)

Usage is essentially the same as FPDI, except importing TCPDI rather than FPDI. It also has a "setSourceData()" function which accepts raw PDF data, for cases where the file does not reside on disk or is not readable by TCPDI.

```
// Create new PDF document.
$pdf = new TCPDI(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// Add a page from a PDF by file path.
$pdf->AddPage();
$pdf->setSourceFile('/path/to/file-to-import.pdf');
$idx = $pdf->importPage(1);
$pdf->useTemplate($idx);

$pdfdata = file_get_contents('/path/to/other-file.pdf'); // Simulate only having raw data available.
$pagecount = $pdf->setSourceData($pdfdata);
for ($i = 1; $i importPage($i);
    $pdf->AddPage();
    $pdf->useTemplate($tplidx);
}
```

TCPDI\_PARSER
=============

[](#tcpdi_parser)

Parser for use with TCPDI, based on TCPDF\_PARSER. Supports PDFs up to v1.7.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b67f269b0bc5c374a38e3a92e61856b5ad0d8563715049617c6330e169b86ed2?d=identicon)[j-barnes](/maintainers/j-barnes)

---

Top Contributors

[![DJTripper](https://avatars.githubusercontent.com/u/18283090?v=4)](https://github.com/DJTripper "DJTripper (14 commits)")[![andreaventuri](https://avatars.githubusercontent.com/u/1456430?v=4)](https://github.com/andreaventuri "andreaventuri (8 commits)")[![kulbakin](https://avatars.githubusercontent.com/u/817433?v=4)](https://github.com/kulbakin "kulbakin (5 commits)")[![pauln](https://avatars.githubusercontent.com/u/574359?v=4)](https://github.com/pauln "pauln (4 commits)")[![j-barnes](https://avatars.githubusercontent.com/u/689432?v=4)](https://github.com/j-barnes "j-barnes (1 commits)")[![lduer](https://avatars.githubusercontent.com/u/3307025?v=4)](https://github.com/lduer "lduer (1 commits)")[![majus28](https://avatars.githubusercontent.com/u/30065310?v=4)](https://github.com/majus28 "majus28 (1 commits)")

### Embed Badge

![Health badge](/badges/j-barnes-tcpdi/health.svg)

```
[![Health](https://phpackages.com/badges/j-barnes-tcpdi/health.svg)](https://phpackages.com/packages/j-barnes-tcpdi)
```

###  Alternatives

[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)[akeneo-labs/excel-connector-bundle

Akeneo PIM Excel connector bundle

166.4k](/packages/akeneo-labs-excel-connector-bundle)

PHPackages © 2026

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