📘 Lesson · Lesson 45
Generate PDF (FPDF)
Generate PDF (FPDF)
About
To create PDF files (invoices, reports, certificates) in PHP, the easiest free library is FPDF.
Simple PDF
require("fpdf.php");
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 16);
$pdf->Cell(40, 10, "Hello, this is a PDF!");
$pdf->Output(); // shows the PDF in browser
Common Uses
- Student mark sheets and certificates.
- Invoices and bills.
- Reports from database data.
Summary
- FPDF creates PDFs: AddPage(), SetFont(), Cell(), Output().
- Great for invoices, certificates and reports.
परिचय
PHP में PDF files (invoices, reports, certificates) बनाने को सबसे आसान free library FPDF है।
Simple PDF
require("fpdf.php");
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "B", 16);
$pdf->Cell(40, 10, "Hello, this is a PDF!");
$pdf->Output(); // browser में PDF दिखाता है
Common Uses
- Student mark sheets और certificates।
- Invoices और bills।
- Database data से reports।
सारांश
- FPDF PDFs बनाता है: AddPage(), SetFont(), Cell(), Output()।
- Invoices, certificates और reports के लिए बढ़िया।
💻 Live Code Editor
Is page ki language (PHP) mein code likhein aur turant chalाएं — yahीं, bina kuch install kiye.Powered by OneCompiler. Agar editor na khule to yahान naye tab mein kholein.
💻 Live Code Editor
Is page ke program yahan ready hain — chalाएं, badlें aur seekhें. Bina kuch install kiye.
Powered by OneCompiler. Editor mein code apne aap aa jata hai — Run dabaakर output dekhें.
Agar load na ho to naye tab mein kholें.