PHP and PDF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello ,
   
  I have managed to download and do some examples in PDF using FPDF.
   
  I can create some pdf files from text files well. But I am failing to open/viewing existing pdf files using this code. 
   
   
  define('FPDF_FONTPATH','font/');
require('..\fpdf.php');
  
class PDF extends FPDF
  {
   function PrintFile($file)
 {
      
  $this->AddPage();
    //Read file
      $f=fopen($file,'r');
      $contents=fread($f,filesize($file));
      fclose($f);
    $this->SetFont('Times','',12);
  
        //Output text 
      $this->MultiCell(0,5,$contents);
      //$this->Ln();
      //$this->SetCol(0);
   }
  }
  
$pdf=new PDF();
$pdf->PrintFile('test1.pdf');
$pdf->Output();
  ?>
   
  Your help is highly appreciated.
   
  Regards
  Justice
   

       
---------------------------------
 For ideas on reducing your carbon footprint visit Yahoo! For Good this month.

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux