I am using FPDF to save the pdf using converting text.
I am using following code :
   <?php
require('fpdf.php');
class PDF extends FPDF
{
function ChapterBody($file)
{
    // Read text file
    $txt = file_get_contents($file);
    $txt = str_replace("{{id_no}}","002",$txt);
    // Times 12
    $this->SetFont('Times','',12);
    // Output justified text
    $this->MultiCell(0,5,$txt);
    // Line break
    $this->Ln();
    // Mention in italics
    $this->SetFont('','I');
    //$this->Cell(0,5,'(end of excerpt)');
}
function PrintChapter($num, $title, $file)
{
    $this->AddPage();
   // $this->ChapterTitle($num,$title);
    $this->ChapterBody($file);
}
}
for($i=0;$i<3;$i++)
{
$pdf = new PDF();
$pdf->PrintChapter('','A RUNAWAY REEF','test.txt');
$pdf->Output('test'.$i.'.pdf','D');
}
?>
I have used for loop to download the pdf file for 3 times, but when I am executing this code then it is downloading only one time with file name test0.pdf, why test1.pdf and test2.pdf id not downloading using this code ?
 
     
    