title: Need Guidance. TCPDF error on output
body: <p>I am having an issue with my TCPDF output error and I'm not sure how to solve it. It said</p>
  
  <blockquote>
    <p>"Warning: Cannot modify header information - headers already sent by
    (output started at C:\xampp\htdocs\Printing\listing_p.php:14) in
    C:\xampp\htdocs\tcpdf\tcpdf.php on line 9043 TCPDF ERROR: Some data
    has already been output to browser, can't send PDF file"</p>
  </blockquote>
  
  <p>I'm quite new to TCPDF and it doesn't have proper tutorial to guide me through. Examples dont help much though...</p>
  
  <p>Here is my codes:</p>
  
  <pre><code>&lt;?php
  
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  ?&gt;
  &lt;!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;insert page&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php 
  
  ob_start();
  
  require_once("../tcpdf/tcpdf.php");
  require_once("../tcpdf/config/lang/eng.php");
  $pdf = &amp; new TCPDF("P","mm","A4",true,"UTF-8",false);
  
  $pdf-&gt;setPrintHeader(false);
  $pdf-&gt;setPrintFooter(false);
  $pdf-&gt;SetAutoPageBreak(false);
  
  $link = mysql_connect("localhost","root");
  if(!$link){
      die('Could not connect: '.mysql_error());
  }
  
  if(mysql_select_db("New_People",$link)){
  mysql_query("SET NAMES utf8");
  
  $result = mysql_query("SELECT * FROM People1");
  
  $pdf-&gt;SetMargins(15,20,15);
  
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('FreeSerif','B',12);
  $pdf-&gt;SetFillColor(255,255,255);
  
  $i = 0;
  $max = 30;
  $row_height = 5;
  $backup_group = "";
  
  $pdf-&gt;Cell(60,$row_height,'Id',1,0,'C',1);
  $pdf-&gt;Cell(60,$row_height,'Code',1,0,'C',1);
  $pdf-&gt;Cell(60,$row_height,'Name',1,0,'C',1);
  
  
  while($row = mysql_fetch_array($result))
  {
      $Id = $row['P_Id'];
      $Code = $row['P_Code'];
      $Name = $row['P_Name'];
  
      if($backup_group != $Id)
      {
          $pdf-&gt;SetFont('FreeSerif','B',12);
          $pdf-&gt;Cell(120,$row_height,$Id,1,1,'C',1);
      }
  
      if($i &gt;$max){
  
          $pdf-&gt;AddPage();
          $pdf-&gt;SetFont('FreeSerif','B',12);
          $pdf-&gt;SetFillColor(255,255,255);
  
          $pdf-&gt;Cell(60,$row_height,'Id',1,0,'C',1);
          $pdf-&gt;Cell(60,$row_height,'Code',1,0,'C',1);
          $pdf-&gt;Cell(60,$row_height,'Name',1,0,'C',1);
  
      }
  
      if(!empty($group)){
          $pdf-&gt;SetFont('FreeSerif','',12);
          $pdf-&gt;Cell(60,$row_height,$Id,1,0,'C',1);
          $pdf-&gt;Cell(60,$row_height,$Code,1,0,'C',1);
          $pdf-&gt;Cell(60,$row_height,$Name,1,0,'C',1);
      }
  
      $backup_group = $Id;
      $i++;
  
  }
  
  mysql_close($link);
  ob_end_clean();
  $pdf-&gt;Output('mypdf.pdf','I');
  
  }
  else{
  die("Error: ".mysql_error());
  }
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any suggestion or help is appreciated. Thanks!</p>