TCPDF is a PHP library for generating PDF documents and barcodes directly in application code.
TCPDF solves the problem of creating PDF output from PHP applications without external dependencies. Starting with version 7, it operates as a compatibility facade over the modern tc-lib-pdf engine. The public API remains unchanged—existing code calling methods like AddPage(), SetFont(), Cell(), and Output() continues to work without modification. Internally, TCPDF delegates PDF generation to tc-lib-pdf's rendering engine while maintaining a compatibility layer that reproduces the legacy stateful cursor model, page management, and automatic features like page breaks and headers/footers.
Developers maintaining legacy PHP systems that depend on TCPDF should understand that the library is in maintenance-only mode. New projects should adopt tc-lib-pdf instead. For existing integrations, TCPDF provides a migration path: the public API is largely unchanged, so existing code runs without alteration. However, output is structurally equivalent rather than byte-identical to the original implementation—documents render with the same content and page sizes, but pagination may shift by a page in long flowing documents due to differences in the modern engine's line-breaking and font metrics. Some legacy behaviors are intentionally not reproduced, including legacy font definitions, EPS/AI vector import, and certain no-op features; the MAPPING.md file documents the delegation status of all 291 public methods.
The project is in maintenance-only mode with active development moved to its successor. TCPDF remains widely installed across PHP packages and receives critical compatibility fixes to maintain security and stability for the shared infrastructure that depends on it.