PHP code example of arimac / fpdf

1. Go to this page and download the library: Download arimac/fpdf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arimac / fpdf example snippets



 = new FPDF();
$pdf->StartDownload('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();



$pdf = new FPDF();
$pdf->StartPreview('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();



$pdf = new FPDF();
$pdf->StartFile('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();