$pdf = new TCPDF(); $pdf->AddPage(); $pdf->SetFont('helvetica', '', 12); $pdf->write1DBarcode('1234567890', 'C39', '', '', '', 18, 0.4, '', 'N'); $pdf->Output();
$pdf = new TCPDF(); $pdf->AddPage(); $pdf->SetFont('helvetica', '', 12); $pdf->write1DBarcode('1234567890128', 'EAN13', '', '', '', 18, 0.4, '', 'N'); $pdf->Output();In this example, we use the write1DBarcode method to create an EAN-13 barcode with the value "1234567890128". The barcode is positioned at the current position of the cursor. Package library: TCPDF.