title: tcpdf in wordpress output crazy code
body: <p>i would like to implement the tcpdf in my wordpress project. I tried to call below example tcpdf file (it's an example from tcpdf), unfortunately its output are crazy code as below,
  %PDF-1.7 %���� 8 0 obj &lt;&lt; /Type /Page /Parent 1 0 R /LastModified (D:20180829011846+00'00') /Resources 2 0 R /MediaBox.....</p>
  
  <p>I have no idea what's the problem of this, many many thanks if any guidance to me, thank you very much.</p>
  
  <pre><code>&lt;?php
  // Include the main TCPDF library (search for installation path).
  require_once(dirname(__FILE__).'/tcpdf/examples/tcpdf_include.php');
  ob_end_clean(); 
  
  // create new PDF document
  $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  
  // set document information
  $pdf-&gt;SetCreator(PDF_CREATOR);
  $pdf-&gt;SetAuthor('Nicola Asuni');
  $pdf-&gt;SetTitle('TCPDF Example 038');
  $pdf-&gt;SetSubject('TCPDF Tutorial');
  $pdf-&gt;SetKeywords('TCPDF, PDF, example, test, guide');
  
  // set default header data
  $pdf-&gt;SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 038', PDF_HEADER_STRING);
  
  // set header and footer fonts
  $pdf-&gt;setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
  $pdf-&gt;setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
  
  // set default monospaced font
  $pdf-&gt;SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
  
  // set margins
  $pdf-&gt;SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  $pdf-&gt;SetHeaderMargin(PDF_MARGIN_HEADER);
  $pdf-&gt;SetFooterMargin(PDF_MARGIN_FOOTER);
  
  // set auto page breaks
  $pdf-&gt;SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
  
  // set image scale factor
  $pdf-&gt;setImageScale(PDF_IMAGE_SCALE_RATIO);
  
  // set some language-dependent strings (optional)
  if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
      require_once(dirname(__FILE__).'/lang/eng.php');
      $pdf-&gt;setLanguageArray($l);
  }
  
  // ---------------------------------------------------------
  
  // set font
  $pdf-&gt;SetFont('helvetica', '', 20);
  
  // add a page
  $pdf-&gt;AddPage();
  
  $txt = 'Example of CID-0 CJK unembedded font.
  To display extended text you must have CJK fonts installed for your PDF reader:';
  $pdf-&gt;Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
  
  // set font
  $pdf-&gt;SetFont('cid0jp', '', 40);
  
  $txt = 'こんにちは世界';
  $pdf-&gt;Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
  
  // ---------------------------------------------------------
  
  //Close and output PDF document
  $pdf-&gt;Output('example_038.pdf', 'I');
  ?&gt;
  </code></pre>