title: iTextPDF not showing Japanese characters from XMLWorkerHelper
body: <p>I'm trying to generate a PDF file using iTextPDF's XMLWorkerHelper. Originally, I am using Apache Velocity Template to generate an HTML code (hence the XMLWorkerHelper being used), but for this question I'll just provide a simple HTML line with Japanese Characters in it.</p>
  
  <pre><code>public class iTextJapChars {
  
  /**
   * @param args
   * @throws IOException 
   */
  public static void main(String[] args) throws IOException {
      // TODO Auto-generated method stub
      FileOutputStream fos = new FileOutputStream("iTextJapChars.pdf");
      (new iTextJapChars()).generate(fos);
      fos.close();
      System.out.println("done!");
  }
  
  public void generate(OutputStream os) throws IOException
  {
      // create a document
      Document document = new Document();
  
      try
      {
          String content = "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;begin　てすと end&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;";
          InputStream stream = new ByteArrayInputStream(content.getBytes("UTF-8"));
          System.out.println(content);
          System.out.println(Charset.defaultCharset());
  
          // create a writer with an output stream passed as an argument
          PdfWriter writer = PdfWriter.getInstance(document, os);
          document.addTitle("﻿身 元 保 証 書");
          document.addAuthor("れお");
          document.addSubject("");
          document.addKeywords("iText, PDF");
          document.addCreator("test.iTextPDF.generate() using iText");
  
          document.open(); // open the document now
  
          XMLWorkerHelper.getInstance().parseXHtml(writer, document, stream);
  
      }
      catch (DocumentException de) { throw new IOException(de.getMessage()); }
      finally { document.close(); } // close the document
  }
  </code></pre>
  
  <p>The problem is, I can't get the resulting PDF file to show the Japanese characters. It only shows blank. Below are the things to note:</p>
  
  <ul>
  <li>CentOS 6.4</li>
  <li>iTextPDF 5.4.3</li>
  <li>XMLWorker 5.4.1</li>
  <li>Adobe Reader 9.5.5</li>
  </ul>
  
  <p>Hope you can help me out here as I have been searching the net for more than a week now and I can't get any of the solutions to work using XMLWorkerHelper. If there is any information I have missed to mention, or I have mentioned a wrong info, please do tell me so I can update. Any help would be much appreciated.</p>
  
  <p>Thank you very much.</p>