I have a basic .vm file which I populate with XML, and then use iText to convert it to a PDF doc:
<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE itext SYSTEM "http://itext.sourceforge.net/itext.dtd">-->
<itext creationdate='${System.DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss")}' producer="X">
<paragraph align="Default" size="18.0" style="bold" indentationleft="0.0">
Test
</paragraph>
</itext>
The above is parsed absolutely fine. However something slightly more complicated:
<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE itext SYSTEM "http://itext.sourceforge.net/itext.dtd">-->
<itext creationdate='${System.DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss")}' producer="X">
<paragraph align="Default" size="18.0" style="bold" indentationleft="0.0">
Test
</paragraph>
<table>
<row>
<cell>
<paragraph>
Table test
</paragraph>
</cell>
</row>
</table>
</itext>
Fails with exception "Unable to cast object of type 'iTextSharp.text.Paragraph' to type 'iTextSharp.text.Table'."
Any ideas? Certainly I can't see any formatting issues.