title: iText - the PDF is not good
body: <p>I have the following HTML:</p>
  
  <pre><code>&lt;div align='center' style='height:50px'&gt;
      &lt;H1&gt;A Simple Sample Web Page&lt;/H1&gt;
      &lt;IMG SRC='http://sheldonbrown.com/images/scb_eagle_contact.jpeg'&gt;
      &lt;H4&gt;By Sheldon Brown&lt;/H4&gt;
      &lt;H2&gt;Demonstrating a few HTML features&lt;/H2&gt;
  &lt;/div&gt;
  HTML is really a very simple language. '
  &lt;P&gt;
  'command, which will insert a blank line.If you would like to make a link or 
  bookmark to this page, the URL is:
  &lt;BR&gt; 
  http://sheldonbrown.com/web_sample1.html
  &lt;/center&gt;
  </code></pre>
  
  <p>But the image appears behind the text instead of below!</p>
  
  <p>What's wrong?</p>
  
  <p>if iText cannot handle it - which library is better?</p>
  
  <p>This is my code:</p>
  
  <pre><code>// step 1
          Document document = new Document();
  
          // step 2
          PdfWriter.getInstance(document, new FileOutputStream("C:\\hello-world.pdf"));
  
          document.open();
          String content = "&lt;div align='center' style='height:50px'&gt;&lt;H1&gt;A Simple Sample Web Page&lt;/H1&gt;&lt;IMG SRC='http://sheldonbrown.com/images/scb_eagle_contact.jpeg'&gt;&lt;H4&gt;By Sheldon Brown&lt;/H4&gt;&lt;H2&gt;Demonstrating a few HTML features&lt;/H2&gt;&lt;/div&gt;HTML is really a very simple language. '&lt;P&gt;' command, which will insert a blank line.If you would like to make a link or bookmark to this page, the URL is:&lt;BR&gt; http://sheldonbrown.com/web_sample1.html&lt;/center&gt;";
  
          // use the snippet for the PDF document
          List&lt;Element&gt; objects = HTMLWorker.parseToList(new StringReader(content), null);
          for (Element element : objects)
              document.add(element);
          document.close();
  </code></pre>