Download the PHP package mgrn/tfpdf without Composer

On this page you can find all versions of the php package mgrn/tfpdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tfpdf

tFPDF

Extended version of the tFPDF library with more features like rollback and enhanced cell writing call

This library is meant to provide a better interface for using the tFPDF libray, which while being a great library, suffers from a somewhat difficult to use api. By introducing a Cell object, which is a collection of all the properties you might wish to set when writing a cell, it can be significantly easier to code consistent cell calls as well as understanding why a cell looks like it does when output. Additionally color management has been improved with the Color class and a ColorsEnum object providing some base colors to use. Additionally this targets PHP 8.1 and so is strongly typed uses enums and class constants to reduce data type exceptions. Currently the library focuses on text enhancements only, and I would expect it's primary usage would be in report building, though anything tFPDF can do, this can do.

Consider the following using the old library, where $pdf is an instance of \tfpdf:

$pdf->SetFont('Arial', 'B', 12);
$pdf->SetFillColor(211,211,211);
$pdf->SetTextColor(255,0,0);
$pdf->SetDrawColor(255,0,0);
$pdf->Cell(100, 0, 'Some Text', 'TB', 0, 'center', true);

Vs in this library, where $pdf is an instance of Pdf:

$cell = new Cell();
$cell->fontFamily = 'Arial';
$cell->fontBold = true;
$cell->fontSize = 12;
$cell->fillColor = Color::fromColor(ColorsEnum::LIGHT_GRAY);
$cell->fontColor = Color::fromColor(ColorsEnum::RED);
$cell->drawColor = Color::fromColor(ColorsEnum::RED);
$cell->width = 100;
$cell->text = 'Some Text';
$cell->border(0,0,1,1); 
$cell->align = AlignEnum::CENTER;
$cell->ln = false;
$cell->fill = true;

$pdf->writeCell($cell);

Right away it's clearer what you intend the cell to output, what the style will be. The use of class methods and enums removes the need to know what tfpdf expects it's string parameters to be. While the newer method may seem longer to set up, in a large PDF this actually becomes less. Like the following:

$cell = new Cell();
$cell->fontFamily = 'Arial';
$cell->fontSize = 12;
$cell->fillColor = Color::fromColor(ColorsEnum::LIGHT_GRAY);
$cell->align = AlignEnum::LEFT;
$cell->ln = false;
$cell->fill = true;

$writeCell = clone $cell;
$writeCell->width = 100;
$writeCell->text = 'Some Text';
$pdf->writeCell($writeCell);

$writeCell = clone $cell;
$writeCell->width = 50;
$writeCell->align = AlignEnum::RIGHT;
$writeCell->text = '$25.32';
$pdf->writeCell($writeCell);

We can set up a template cell this way, to set some basic style properties and then clone it, and only modify what changes from cell to cell. This allows clarity of code as well as making it possible to set up a template style at the beginning, and easily change it should you need to without having to change lots of Set[property] methods or Cell or MultiCell calls. One call performs both the function of Cell and MultiCell, and performs it in a manner more consistantly like one would expect.

Some features include:

To use, create an instance of the \Mgrn\Tfpdf\Pdf object or an instance of a class extending \Mgrn\Tfpdf\Pdf. See the test for an example of how to use this library as well as what you can expect as outputs.


All versions of tfpdf with dependencies

PHP Build Version
Package Version
Requires ext-mbstring Version *
setasign/tfpdf Version 1.32
php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mgrn/tfpdf contains the following files

Loading the files please wait ....