Download the PHP package tecnickcom/tcpdf without Composer

On this page you can find all versions of the php package tecnickcom/tcpdf. 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?
tecnickcom/tcpdf
Rate from 1 - 5
Rated 3.67 based on 3 reviews

Informations about the package tcpdf

TCPDF (DEPRECATED → use tc-lib-pdf)

[!WARNING] TCPDF is in maintenance-only mode. Active development has moved to tc-lib-pdf, its modern, modular successor — new projects should start there.

TCPDF is still installed 100M+ times across 500+ PHP packages. If your product depends on it, sponsor continued maintenance → to keep this shared infrastructure secure and patched.

Sponsor on GitHub

Latest Stable Version License Downloads


Overview

TCPDF is a pure-PHP library for generating PDF documents and barcodes directly in application code.

It has been widely used across many PHP stacks and still provides a complete feature set for text rendering, page composition, graphics, signatures, forms, and standards-oriented output.

Package tecnickcom/tcpdf
Author Nicola Asuni [email protected]
License GNU LGPL v3 (see LICENSE.TXT)
Website http://www.tcpdf.org
Source https://github.com/tecnickcom/TCPDF

Architecture: Compatibility Facade over tc-lib-pdf

Starting with this version, the TCPDF class no longer contains its own PDF engine. It is a compatibility facade: every public TCPDF method is a thin wrapper that delegates the actual PDF generation to the modern tecnickcom/tc-lib-pdf engine (\Com\Tecnick\Pdf\Tcpdf), while a small internal state layer reproduces the legacy stateful cursor and page model (current X/Y, margins, fonts, colors, automatic page breaks, headers/footers).

What this means in practice:


Deprecation Notice

TCPDF is deprecated and in maintenance-only mode.

Active feature development has moved to tc-lib-pdf, the modern and modular successor.

For new projects, use tecnickcom/tc-lib-pdf. This repository remains available for legacy systems and critical compatibility fixes.

Migration Path

Migrating Font Assets

TCPDF has migrated font loading to the tc-lib font stack (see "Breaking Changes" below).

Who is affected:

How to migrate custom font usage:

  1. Install dependencies with Composer.
  2. Ensure tc-lib font assets are available in vendor/tecnickcom/tc-lib-pdf-font/target/fonts/.
  3. Keep using SetFont()/AddFont() from TCPDF, but validate that each custom family resolves from tc-lib assets or from your explicit font path.
  4. Update deployment packaging so vendor/ font assets are shipped in production.

Font generation procedure (Makefile):

  1. Run make deps to install Composer dependencies and initialize tc-lib font assets.
  2. Run make fonts to initialize fonts only when missing.
  3. Run make fonts-rebuild to force a full font asset rebuild.

Expected generated asset sentinel:

Compatibility notes:

Example:

Safe migration checklist:

  1. Require tecnickcom/tc-lib-pdf in Composer and install dependencies.
  2. Confirm the font asset directory exists under vendor/tecnickcom/tc-lib-pdf-font/target/fonts/.
  3. Run your PDF smoke tests for headers, body text, bold/italic, RTL text, and Unicode text.
  4. Verify no runtime path assumptions require repository fonts/ files.
  5. Remove legacy K_PATH_FONTS overrides that point to removed directories.
  6. Re-run regression output comparisons on representative documents.

Why Migrate to tc-lib-pdf

Migration still requires planning and regression checks to preserve rendering parity for existing documents.


Breaking Changes

The facade favors the modern engine model over bug-for-bug legacy emulation in the following areas. Each is a deliberate, documented contract change:

  1. Font model. Fonts are resolved exclusively through the tc-lib-pdf-font stack: JSON definition files discovered under K_PATH_FONTS (vendor/tecnickcom/tc-lib-pdf-font/target/fonts/, generated by make fonts). The legacy TCPDF font definition format (fontname.php + fontname.z / fontname.ctg.z) is not supported and is not converted at runtime:

    • SetFont()/AddFont() accept families known to the tc-lib font stack (core fonts, DejaVu, FreeFont, CID-0, ...) or definition files in the tc-lib JSON format via the font-file parameter.
    • Legacy-only bundled fonts (e.g. aefurat, aealarabiya) are unavailable; requesting them throws a font exception. Use a tc-lib font with equivalent coverage (e.g. freeserif/dejavusans for Arabic) or import the original TTF/OTF with the tc-lib-pdf-font importer.
    • Font subsetting, kerning and metrics follow the tc-lib implementation.

    See "Migrating Font Assets" above for the step-by-step migration procedure.

  2. Stream compression is always on. setCompression(false) is a no-op; the engine always compresses content streams.
  3. EPS/AI vector import is dropped. The modern engine has no PostScript interpreter, so ImageEps() ignores EPS/AI input. Convert EPS/AI artwork to SVG (e.g. inkscape file.eps --export-filename=file.svg) and use ImageSVG() instead. As a convenience, ImageEps() dispatches SVG and raster file names to the modern paths.
  4. RC4 encryption is legacy-only. setProtection() modes 0/1 still work, but the engine deprecates RC4; AES modes (2/3) are recommended. setProtection() must be called before the first page is added.
  5. Resource loading is policy-based. The engine restricts where external resources (images, fonts, SVG, imported PDFs) may be loaded from: local reads are limited to an allowlist of trusted directories and remote (HTTP/HTTPS) reads are disabled by default. The legacy setAllowLocalFiles() toggle no longer widens access; the policy is driven by configuration constants instead (see Resource Loading Security).

Smaller deliberate no-ops (disk caching, setDocInfoUnicode(), header XObject template caching, vector-image rasterization toggles, ...) are listed with their reasons in MAPPING.md.

Resource Loading Security

External resources are fetched through the sandboxed file helper provided by tc-lib-pdf / tc-lib-file. The sandbox enforces two independent allowlists, both configurable via define() constants (read by tcpdf_autoconfig.php, overridable in config/tcpdf_config.php or before the autoconfig runs):

Constant Type Default Purpose
K_ALLOWED_PATHS string[] [] Extra trusted local directory prefixes, merged on top of the built-in defaults.
K_ALLOWED_HOSTS string[] [] Trusted remote host names that enable HTTP/HTTPS loading. Empty keeps remote loading disabled.
K_MAX_REMOTE_SIZE int 52428800 Byte cap for a single remote download (50 MiB).
K_CURLOPTS array [] Extra CURLOPT_* => value pairs merged over the cURL defaults.

Local reads. The built-in allowlist always covers the system temp directory, K_PATH_MAIN, the bundled vendor/tecnickcom/ directory, the current working directory, K_PATH_FONTS, K_PATH_IMAGES and the running script's directory. K_ALLOWED_PATHS only ever widens this set — paths are resolved with realpath(), so non-existent or unresolvable entries are silently ignored and traversal/symlink tricks collapse to their canonical prefix. There is no way to read below the built-in roots.

Remote reads. Remote URL loading is off by default — the single most important defense against SSRF when rendering untrusted HTML/markup. To opt in, list the exact host names you trust in K_ALLOWED_HOSTS. TLS certificate verification and redirect handling are enforced upstream and cannot be relaxed through K_CURLOPTS.

Document encryption is a separate concern: setProtection() (item 4 above) controls the PDF permission flags and password/public-key encryption and is unaffected by these resource-loading constants.


Requirements

Optional extensions for richer output in some workflows: gd (automatic raster format conversion), zlib.


Development & Quality Assurance

This repository ships a real validation harness:

Command Purpose
make deps Install Composer dependencies, tooling, and initialize tc-lib font assets
make qa Full gate: mago lint + static analysis + PHPUnit suite
make test Run the PHPUnit suite (test/)
make smoke Run all 68 example scripts headless and verify the produced PDF documents
make inventory Regenerate the public method inventory reports
make mapping Verify the delegation map and regenerate MAPPING.md

The example smoke runner (scripts/example_smoke.php) requires pdfinfo (poppler-utils) and treats any warning, notice, or deprecation as a failure. Examples that exercise a declared breaking change can be tracked as expected failures with a documented reason (currently none: all 68 examples pass).


Third-Party Fonts

Third-party bundled font assets are provided through tecnickcom/tc-lib-pdf-font under vendor/tecnickcom/tc-lib-pdf-font/target/fonts/.

TCPDF no longer ships a repository-local fonts/ directory.

For full details, see the bundled notices shipped by tecnickcom/tc-lib-pdf-font.



All versions of tcpdf with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-curl Version *
tecnickcom/tc-lib-pdf Version ^8
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 tecnickcom/tcpdf contains the following files

Loading the files please wait ...