Save PDF in folder

Save PDF in folder

Posted in : PHP Posted on : January 15, 2011 at 7:04 PM Comments : [ 0 ]

This section contains the detail about the Save PDF in folder.

Save PDF in folder

In this tutorial you will learn how to save PDF in folder in a PHP web application. In this tutorial use

  • save-pdf-in-folder.php.
  • fpdf16 folder (PDFlib).
  • pdffile folder.

The code 'save-pdf-in-folder.php'  given below :


class SimpleTable extends FPDF
function generateTable($no)
$this->cell(20,10," * ".$i,1,0,"C");
$this->cell(20,10," = ".$i*$no,1,1,"C");
$pdf=new SimpleTable();
$filename= "filename.pdf";
$pdf ->Output($dir.$filename);
echo "Save PDF in folder";

In the 'save-pdf-in-folder.php' create SimpleTable  class that extends FPDF class  and  generateTable() function that create table with cell content. The generated PDF save in  "C:/wamp/www/pdf-php-tutorial/pdffile/" directory and PDF name  "filename.pdf" .

Output :

  When run  'save-pdf-in-folder.php' file generate PDF and store in "C:/wamp/www/pdf-php-tutorial/pdffile/" directory and display output message as :

When open folder "pdffile" display PDF as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image

Tutorial Topics