i want to create a pdf using itextsharp in which chemical formula.
please give me an example of PdfStamper converting chemical formula <p>C<sub>32</sub>H<sub>16</sub>CuN<sub>8</sub></p> to C32H16CuN8
table = new PdfPTable(2);
table.SetWidths(new float[] { 0.3f, 0.7f });
table.TotalWidth = 500f;
table.LockedWidth = true;
table.SpacingBefore = 5f;
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
lblChemicalFormula.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
HTMLWorker htmlparser = new HTMLWorker(document);
htmlparser.Parse(sr);
String pathin = "C:\\Users\\Admin\\Downloads\\Employee.pdf";
String pathout = "C:\\Users\\Admin\\Downloads\\Employee.pdf";
PdfReader reader = new PdfReader(pathin);
PdfStamper stamper = new PdfStamper(reader, new FileStream(pathout, FileMode.Create));
List list = new List(List.ORDERED);
string text = "<p>C<sub>32</sub>H<sub>16</sub>CuN<sub>8</sub></p>";
List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(text), null);
for (int k = 0; k < htmlarraylist.Count; k++)
{
list.Add((IElement)htmlarraylist[k]);
}
ColumnText ct = new ColumnText(stamper.GetOverContent(1));
ct.AddElement(list);
Rectangle rect = new Rectangle(46, 190, 530, 36);
ct.SetSimpleColumn(rect);
ct.Go();
stamper.Close();
table.AddCell(PhraseCell(new Phrase("Chemical Formula :", FontFactory.GetFont("Verdana", 8, Font.BOLD, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
table.AddCell(PhraseCell(new Phrase(lblChemicalFormula.Text, FontFactory.GetFont("Verdana", 8, Font.NORMAL | Font.UNDERLINE, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
document.Add(table);