FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. It is free to use and it does not require any API keys. FPDF stands for Free PDF. It means that any kind of modification can be done in PDF files.
Feature -
- Choice of measure unit, page format and margins
- Page header and footer management
- Automatic page break
- Automatic line break and text justification
- Image support (JPEG, PNG and GIF)
- Colors
- Links
- TrueType, Type1 and encoding support
- Page compression
PHP-FPDF Code for PDF Generation -
This code is used to generate PDF for displaying text file data. Download FPDF to execute this script.
<?php
require('fpdf/fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$row=file('abc.txt');
$pdf->SetFont('Arial','B',12);
foreach($row as $rowValue) {
$data=explode(';',$rowValue);
foreach($data as $columnValue)
$pdf->Cell(90,12,$columnValue,1);
$pdf->SetFont('Arial','',12);
$pdf->Ln();
}
$pdf->Output();
?>
2 comments:
Glad to visit this blog, really helpful. Gathered lots of information and waiting to see more updates.
PHP website development
PHP Web Development Tools
PHP Trends
Glad to visit this blog, really helpful. Gathered lots of information and waiting to see more updates.
PHP website development
Post a Comment