require('fpdf/fpdf.php'); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output();
require('fpdf/fpdf.php'); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(50,10,'Name',1); $pdf->Cell(50,10,'Age',1); $pdf->Ln(); $pdf->SetFont('Arial','',12); $pdf->Cell(50,10,'John Smith',1); $pdf->Cell(50,10,'25',1); $pdf->Ln(); $pdf->Cell(50,10,'Jane Doe',1); $pdf->Cell(50,10,'30',1); $pdf->Output();
require('fpdf/fpdf.php'); $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->SetFillColor(255, 0, 0); $pdf->SetTextColor(255); $pdf->Cell(50,10,'Name',1,0,'C',true); $pdf->Cell(50,10,'Age',1,0,'C',true); $pdf->Ln(); $pdf->SetFont('Arial','',12); $pdf->SetFillColor(255); $pdf->SetTextColor(0); $pdf->Cell(50,10,'John Smith',1,0,'C',false); $pdf->Cell(50,10,'25',1,0,'C',false); $pdf->Ln(); $pdf->Cell(50,10,'Jane Doe',1,0,'C',false); $pdf->Cell(50,10,'30',1,0,'C',false); $pdf->Output();This example creates a table with custom border styles, using different colors for the cell background and text. Package Library: FPDF