title: UTF-8 PDF generated with TCPDF showing up fine in Adobe Acrobat but corrupted in Illustrator and Google preview
body: <p>I use PHP and TCPDF to generate online invoices encoded in utf8. I've created font definition files following the tutorial on the tcpdf website using PT-sans .ttf file. </p>
  
  <p>Generated pdf files look fine (accents are displayed correctly) when opened with Adobe Reader. But as soon as you open the pdf file with Adobe Illustrator, you'll see a mix of normal ascii characters and missing characters signs. When opened as attachment in the gmail preview, no text is displayed at all, just images will show up.</p>
  
  <p>I also get unconsistent behavior with Foxit reader. It was ok on one computer (with font installed), but corrupted on another (without the font installed). </p>
  
  <p>Illustrator (on the left) and Foxit reader printscreen: <a href="http://dl.dropbox.com/u/14647415/illustrator%20and%20foxit.jpg" rel="nofollow">http://dl.dropbox.com/u/14647415/illustrator%20and%20foxit.jpg</a></p>
  
  <p>Here is a copy of the corrupted file: <a href="http://dl.dropbox.com/u/14647415/2011040-3.pdf" rel="nofollow">http://dl.dropbox.com/u/14647415/2011040-3.pdf</a></p>
  
  <p>PDF's size is ±200kB, so font seems to be embeded correctly.</p>
  
  <p>This seems to happen with any utf8 font, embeded with procedure described on the tcpdf website. When I tried the core cid fonts, that came with the tcpdf library, accented characters were missing, or have been replaced with ?, but the overal layout and text were ok in Illustrator, too. Attached utf-8 fonts like Dejavusans are showing up corrupted, too.</p>
  
  <p>I use 'UTF-8' as a param passed into tcpdf constructor.</p>
  
  <p>class XTCPDF extends TCPDF
  {</p>
  
  <pre><code>function __construct(){
      parent::__construct('P', 'mm', 'A4', true, 'UTF-8', false);
      ...
  }
  ...
  </code></pre>
  
  <p>}</p>
  
  <p>Do you have any ideas on what could be causing this?</p>
  
  <p>Thank you very much in advance.</p>
  
  <p>p.</p>