title: magento FPDF error: Some data has already been output, can't send PDF file
body: <p>i'm having the next problem: </p>
  
  <p>I try to see a pdf in one magento phtml this is my code:</p>
  
  <pre><code>$fileName = Mage::getConfig()-&gt;getOptions()-&gt;getMediaDir()."/pdf/Gutschein-v2.pdf";
  
  $pdf = new FPDI();
  $pdf-&gt;addPage();
  $pdf-&gt;setSourceFile($fileName);
  
  $tplIdx = $pdf-&gt;importPage(1);
  // use the imported page and place it at point 10,10 with a width of 100 mm
  
  $pdf-&gt;useTemplate($tplIdx, 10, 10, 100);
  
  // now write some text above the imported page
  $pdf-&gt;SetFont('Helvetica');
  $pdf-&gt;SetTextColor(255, 0, 0);
  $pdf-&gt;SetXY(30, 30);
  $pdf-&gt;Write(0, 'This is just a simple text');
  
  //ob_start();
  $pdf-&gt;Output();
  //ob_end_flush(); 
  </code></pre>
  
  <p>When i comment ob_start(); i see on my screen the next error:
  FPDF error: Some data has already been output, can't send PDF file</p>
  
  <p>When i don't comment that i see the normal pdf format but not the white page with 
  my pdf, i tried to do that with pure php and everything was ok example:
  <a href="http://milton.bommelme.com/fpdf/pddf.php" rel="nofollow">http://milton.bommelme.com/fpdf/pddf.php</a></p>
  
  <p>but with magento something are not gut, maybe i don't know how to load the pdf or something else. I'm very new with magento.</p>
  
  <p>thank you.</p>