title: Using flying saucer convert html to Image
body: <p>Using flying saucer, i successfully convert html to image using below code</p>
  
  <pre><code>//doc - html source code as org.w3c.dom.Document
  
  Java2DRenderer renderer = new Java2DRenderer(doc, width, height); 
  
           BufferedImage img = renderer.getImage();
  
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          ImageIO.write(img, "jpg", os);
  </code></pre>
  
  <p>But i have problems in the above code like it does not render the font properly in the html.</p>
  
  <p>Also if the chinese ,Japanese or other than Ascii characters given, the image has not been rendered with proper content(characters are boxed like below). </p>
  
  <p><a href="https://i.stack.imgur.com/k0jg1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k0jg1.jpg" alt="enter image description here"></a></p>
  
  <p>But actual html content is </p>
  
  <pre><code>&lt;div &gt;&lt;ul&gt;&lt;li&gt;&lt;dl&gt;&lt;dt&gt;&lt;a href="http://jcs2014.com/ja/about/"&gt;イベントについて&lt;/a&gt;&lt;br&gt;&lt;/dt&gt;&lt;dd&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jcs2014.com/ja/about/support.html"&gt;サポーター&amp;amp;フレンズ&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;dl&gt;&lt;dt&gt;&lt;a href="http://jcs2014.com/ja/event/"&gt;イベント･セミナー一覧&lt;/a&gt;&lt;br&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Also in my case, any language will come, but all encoded using unicode. How to solve this. </p>
  
  <p>Please help.</p>