<DIV> inside <FONT> and <SPAN> is not working in xmlWorker

342 Views Asked by At

we are using iText XML Worker version 5 to generate PDF from HTML snippet but it seems like Text1 wrapping by DIV is not coming in PDF. any idea why DIV tag is not working in above snippet?

I Have HTML Snippet code like below

<HTML>
     <BODY>
          <DIV> 
              <FONT>   
                  <SPAN>  
                    --- this text is missing in pdf
                    <DIV> Text1</DIV>           
                  </SPAN>
              </FONT>
         </DIV> 
     </BODY>
</HTML>
1

There are 1 best solutions below

2
Tasha On

Even though it is not common practice to place a DIV tag (which is a block element) inside a SPAN (which is a inline element), I get an output.

As far as I know the FONT tag is not supported in HTML5. So maybe removing the FONT tag will do it?