title: Fatal error: Class 'TCPDF' not found
body: <p>I am generating the PDF file but facing the trouble. Can anybody tell me the solution of this error. Below is the code that I used for that. I include the tcpdf for this but there is a fatal error that saying that tcpdf file in not available or we can say not found.</p>
  
  <pre><code>&lt;?php
      $tcpdf_include_dirs = array(realpath('tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
      foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
          if (@file_exists($tcpdf_include_path)) {
              require_once($tcpdf_include_path);
              break;
          }
      }
  
      $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // Create New PDF Doc
      $pdf-&gt;SetCreator(PDF_CREATOR); //Setup a document information
  
      include("db_connection.php");       
  
      $isql = mysqli_query($con, "SELECT * FROM `cpdf`") OR die("Data Select problem: ".mysqli_error($con));
      $num = mysqli_num_rows($isql);
  
      $pdf-&gt;AddPage(); //Add new page
  
      while($row = mysqli_fetch_array($isql)){
          $firstname = $row['fname'];
          $lastname = $row['lname'];
          $fullname = $firstname ." ".$lastname;
          ?&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;PDF Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form&gt;
              &lt;div&gt;
                  &lt;div&gt;&lt;img style="width: 100%; height: 20%" src="image/FlZJRBAXRlweb design.idevtechnolabs.socialsigna.l.JPG"/&gt;&lt;/div&gt;
                  &lt;div style="width: 100%; height: 30%"&gt;
                      &lt;table style="float: right; border: 2;"&gt;
                          &lt;tr style="width: 10%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $fullname; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                          &lt;tr style="width: 20%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $row['add1']; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                          &lt;tr style="width: 20%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $row['add2']; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                          &lt;tr style="width: 20%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $row['city']; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                          &lt;tr style="width: 20%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $row['state']; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                          &lt;tr style="width: 20%;"&gt;&lt;td style="text-align: left;"&gt;&lt;?php echo $row['date']; ?&gt;&lt;/td&gt;&lt;/tr&gt;
                      &lt;/table&gt;
                  &lt;/div&gt;
                  &lt;div style="float: left; height: 10%;"&gt;
                      &lt;b&gt;Subject:&lt;/b&gt; &lt;?php echo $row['subject']; ?&gt;
                  &lt;/div&gt;
                  &lt;div style="height: 40%; width: 100%;"&gt;
                      &lt;p style="text-align: justify;"&gt;Hey, &lt;br /&gt;&lt;br /&gt; Mr. &lt;?php echo $fullname; ?&gt;. This is to inform you that a day after tomorrow is the last date of your invoice payment. This is a reminder notice to pay your &lt;?php echo $row['bill']; ?&gt; invoice amount our nearest store and takes advantage of our services.&lt;/p&gt;
                      &lt;p style="text-align: justify; text-indent: 4em;"&gt;We request you to pay your &lt;?php echo $row['bill']; ?&gt; Bill as soon as possible.&lt;/p&gt;
                      &lt;span style="float: right;"&gt;Thank you,&lt;br /&gt;&lt;img src="#"/&gt;&lt;/span&gt;
                  &lt;/div&gt;&lt;?php $pdf-&gt;Write(0, $txt, '', 0, 'C', true, 0, false, false, 0); 
                  } 
                  $pdf-&gt;Output('example_002.pdf', 'I'); ?&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>