title: Creating a dynamic PDF in Java
body: <p>This is not a duplicate question. I had searched and tried many options before posting this question.    </p>
  
  <p>We have a web page, in which user should be able to input data in text boxes, text areas, images and also Rich Text editors. This data has to be filled in an existing report, like filling the blanks. </p>
  
  <p>I was able to achieve the functionality using Apache FOP when the user input is simple text. But Apache FOP doesn't work if the user input is Rich Text(html format). FOP will not render html, and it just pushes the html code(ex: <code>&lt;strong&gt; XYZ /strong&gt;</code>) into the pdf. 
  I tried using iText, but the setback here is that even though iText supports rendering of html to pdf, it is not able to place the images, that are included in <code>&lt;img&gt;</code> tags, in the pdf file. </p>
  
  <p>I can try to create a pdf using iText api block by block, but the problem is rich text data entered by the user can not be embedded between the code since building pdf block by block and html to pdf can not be done together in iText. Or at least that is what I think from my experience. </p>
  
  <p>Is there any other way to create a pdf file from java with images, rich text rendering as it is, headers and footers?</p>