<?
php
// Include the FPDF library (make sure the fpdf.php file is in the same
directory or include the path)
require('fpdf/fpdf.php');
// Create a PDF object
$pdf = new FPDF();
// Add a page
$pdf->AddPage();
// Set font for the PDF (family, style, size)
$pdf->SetFont('Arial', 'B', 16);
// Add a title
$pdf->Cell(200, 10, 'Sample PDF Created with FPDF', 0, 1, 'C');
// Set a smaller font for the content
$pdf->SetFont('Arial', '', 12);
// Add some content to the PDF
$pdf->Ln(10); // Line break
$pdf->MultiCell(0, 10, 'This is a sample PDF created using the FPDF library in
PHP. You can add text, images, tables, and much more. This is just a simple
example of how to generate PDFs programmatically using PHP and FPDF.');
$pdf->Ln(10);
$pdf->Cell(200, 10, 'Another Line of Text Below.', 0, 1, 'L');
// Output the PDF (either as a file or to the browser)
$pdf->Output('F', 'example.pdf'); // 'F' indicates saving the file. Use 'I' to
display in browser.
?>