Skip to content

Migration hub

Move to NextPDF, on your terms.

Coming from another PHP PDF library? Here is the honest path to a PDF 2.0 engine — including a drop-in compatibility adapter that turns most TCPDF migrations into a one-line change.

The one-line case

Coming from TCPDF? Change one import.

The nextpdf/compat-legacy adapter keeps TCPDF’s class and method surface, so most call sites change only their use line — then you are on the PDF 2.0 engine.

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');

One line changes

use NextPDF\Compat\Tcpdf\TCPDF;  // the only change

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

Full TCPDF migration guide →

Migration guides describe your path to NextPDF and what you gain. Where we state a fact about another library, it is sourced and dated; we frame every move as “coming from X”, never as a judgement of the tool you are leaving.