Skip to content

Migration hub

Bring your PDF code forward

Start with the calls you already have. Compare the code, review the compatibility surface, and move each document on your schedule.

TCPDF compatibility

Change the compatibility import

The nextpdf/compat-legacy adapter preserves selected TCPDF 6.2.13 call signatures, including method names, parameter order, and defaults. Most call sites change only their use line.

Two versions of the same printed proof laid in exact register, with the underlying sheet visible only at the margin.Two versions of the same printed proof laid in exact register, with the underlying sheet visible only at the margin.
call-site.phpImport change

Your TCPDF code

use TCPDF;

$pdf = new TCPDF('P', 'mm', 'A4');
$pdf->SetFont('helvetica', '', 12);
$pdf->AddPage();
$pdf->writeHTML($html);
$pdf->Output('invoice.pdf', 'F');

Compatibility import

// Import the compatibility adapter
use NextPDF\Compat\Tcpdf\TCPDF;

$pdf = new TCPDF('P', 'mm', 'A4');
$pdf->SetFont('helvetica', '', 12);
$pdf->AddPage();
$pdf->writeHTML($html);
$pdf->Output('invoice.pdf', 'F');

The adapter delegates 94 of approximately 120 surveyed TCPDF 6.x methods to NextPDF.

Review the full TCPDF migration →

Starting points

Choose the API you know