PHPackages                             majkel.org/tcpdf-warper - 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. majkel.org/tcpdf-warper

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

majkel.org/tcpdf-warper
=======================

Create PDF documents using TCPDF fluent interface

v0.2.4(10y ago)219MITPHPPHP &gt;=5.4.0

Since Dec 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/majkel89/tcpdf-warper)[ Packagist](https://packagist.org/packages/majkel.org/tcpdf-warper)[ RSS](/packages/majkelorg-tcpdf-warper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (10)Used By (0)

TCPDF Warper
============

[](#tcpdf-warper)

[![Build Status](https://camo.githubusercontent.com/41c39d388a2a84ef356161c4a63344b7852854e557c41171fedb1adfb863f082/68747470733a2f2f7472617669732d63692e6f72672f6d616a6b656c38392f74637064662d7761727065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/majkel89/tcpdf-warper)[![SensioLabsInsight](https://camo.githubusercontent.com/9899edac138326e363457fbaa4dd4dc0e0922ff301e197e11cc2074d533faf7b/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31353165656334352d343738622d343165342d616135382d3063326438366434663336612f6d696e692e706e67)](https://insight.sensiolabs.com/projects/151eec45-478b-41e4-aa58-0c2d86d4f36a)[![Code Climate](https://camo.githubusercontent.com/ae54918a1d00d3b81a06bfbc2eead8385a564e73de55c51b553953fdb31a19f2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d616a6b656c38392f74637064662d7761727065722f6261646765732f6770612e737667)](https://codeclimate.com/github/majkel89/tcpdf-warper)[![Test Coverage](https://camo.githubusercontent.com/0bfaa06bac6df53acaf418a3be84822fd8aae3fd66138ea4bfc5f9c296669bf7/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d616a6b656c38392f74637064662d7761727065722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/majkel89/tcpdf-warper/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/8968fedf7febdcc8155cb1947c2030ecb84c28d26de31670ec4f811aada58790/68747470733a2f2f706f7365722e707567782e6f72672f6d616a6b656c2e6f72672f74637064662d7761727065722f762f737461626c65)](https://packagist.org/packages/majkel.org/tcpdf-warper)[![Latest Unstable Version](https://camo.githubusercontent.com/3722b9f370475a4814defcf5745ab3867db512c3091aae84e8f8f6f6eb9691b9/68747470733a2f2f706f7365722e707567782e6f72672f6d616a6b656c2e6f72672f74637064662d7761727065722f762f756e737461626c65)](https://packagist.org/packages/majkel.org/tcpdf-warper)[![PHP Version](https://camo.githubusercontent.com/de1d3a23aaaf6f3f20d5d84e20df74755202c22a12c29580f26fd071bf61a455/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e342532422d6c69676874677265792e737667)](https://camo.githubusercontent.com/de1d3a23aaaf6f3f20d5d84e20df74755202c22a12c29580f26fd071bf61a455/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d504850253230352e342532422d6c69676874677265792e737667)[![License](https://camo.githubusercontent.com/1b9ddc59a3864cd09abb3f9a646ff379866e037888bf620b7da03724bc15da8f/68747470733a2f2f706f7365722e707567782e6f72672f6d616a6b656c2e6f72672f74637064662d7761727065722f6c6963656e7365)](https://packagist.org/packages/majkel.org/tcpdf-warper)

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

[](#installation)

```
 composer require tecnick.com/tcpdf       ### or any TCPDF library
 composer require org.majkel/tcpdfwarper

```

About
-----

[](#about)

Provides fluent statement builders for TCPDF library.

Mine intention was to make calls to methods, with many arguments, clearer and more maintainable.

```
// instead of
$pdf = new \TCPDF();
$pdf->Image($file, $x, $y, $w, $h, '', '', '', true, 300, '',
         true, false, 10, true, false, false, true, $altimgs);

// you can use this
$pdf = new \org\majkel\tcpdfwarper\TCPDFWarper();
$pdf->buildImage()->setFile($file)
    ->setPos(20, 20)->setSize(64, 64)
    ->setAlt(true)->setAltImgs($altimgs)
    ->render();

```

No more hassle with remembering which argument is which or hardcodeing long list of parameters just to change last one of them.

Following methods are supported

- Cell (buildCell)
- Multicell (buildMulticell)
- Image (buildImage)
- ImageSvg (buildImageSvg)
- ImageEps (buildImageEps)
- Text (buildText)
- writeHTML (buildHtml)
- writeHTMLCell (buildHtmlCell)
- write1DBarcode (buildBarcode1d)
- write2DBarcode (buildBarcode2d)
- Write (buildWrite)

If you are using some kind of fork of TCPDF, you can write your own warper. Every statement builder allows you to inject $tcpdf object.

```
 $image = new \org\majkel\tcpdfwarper\ImageOp($tcpdf);
 $image->setFile($file)
     ->setPos(20, 20)->setSize(64, 64)
     ->render();

```

Features
========

[](#features)

- Fully unit tested
- Full code coverage
- Code completion friendly (including documentation)
- Tested against multiple php versions (5.4 - 7.0, hhvm)
- Tested against multiple TCPDF libraries (see travis)

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2015 Michał (majkel) Kowalik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[![Bitdeli Badge](https://camo.githubusercontent.com/f7f0587ec5bc70af9dc84c5a72fb2d2dd18e1f37f8ba8b36852a71d2334dc1b9/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f6d616a6b656c38392f74637064662d7761727065722f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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 ~49 days

Recently: every ~93 days

Total

9

Last Release

3755d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.3.0

v0.2.0PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![majkel89](https://avatars.githubusercontent.com/u/1094964?v=4)](https://github.com/majkel89 "majkel89 (35 commits)")

---

Tags

pdfTCPDFwarper

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/majkelorg-tcpdf-warper/health.svg)

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

###  Alternatives

[tecnickcom/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k101.8M472](/packages/tecnickcom-tcpdf)[tecnickcom/tc-lib-pdf

PHP PDF Library

1.8k452.3k7](/packages/tecnickcom-tc-lib-pdf)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[propa/tcpdi

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

231.1M1](/packages/propa-tcpdi)[ensepar/html2pdf-bundle

Use HTML2PDF as a Symfony Service

27669.3k](/packages/ensepar-html2pdf-bundle)[bithost-gmbh/pdfviewhelpers

This is a TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.

45242.7k2](/packages/bithost-gmbh-pdfviewhelpers)

PHPackages © 2026

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