$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetFont('times', '', 12); $pdf->AddPage(); $pdf->SetXY(10, 10); //Set the X,Y coordinates to (10,10) $pdf->Cell(0, 0, 'Hello world!'); $pdf->Output();
$pdf->SetXY($x, $y);This is a more general usage of the SetXY method, where we pass the X and Y coordinates as parameters. This can be used to set the current position to any location on the PDF page. Package Library: TCPDF is a popular PHP package library that allows you to easily create PDF documents using PHP. It is released under the LGPLv3 license and is available for free download from its official website. Its comprehensive documentation and active community make it a reliable and efficient tool for PDF generation.