title: PDF from HTML String with HTML tags in C# ASP.Net
body: <p>I am using ITextSharp to create PDF from HTML String. I have written following code, But If strReplace is a my HTML string with tag, How I generate PDF using itextSharp in C# ?</p>
  
  <pre><code>      MemoryStream PDFData = new MemoryStream();
        Document document = new Document(PageSize.LETTER, 50, 50, 80, 50);
        PdfWriter PDFWriter = PdfWriter.GetInstance(document, PDFData);
        PDFWriter.ViewerPreferences = PdfWriter.PageModeUseOutlines;
  
  
       document.Open();
       AddOutline(PDFWriter, "", document.PageSize.Height);
  
       document.Add(new Paragraph("\r\n"));
  
         StringBuilder strReplace = new StringBuilder();
         strReplace.Append(strTemplate);
  
  
                          var query = (from c in objAMSContainer.tblincomes
                                       join o in objAMSContainer.tblincomedetails on     c.colId equals o.ColId
                                       where c.colId == 9
                                       &amp;&amp; c.colIsDeleted == false
                                       select new { c.colId, o.colQuantity, o.colPrice, o.colAmount }).ToList();
  
                          for (int j = 0; j &lt; query.Count; j++)
                          {
  
                              // strReplace.Replace("[ITEM]", Convert.ToString(query[j].colId));
                              strReplace.Replace("${QTY}", Convert.ToString(query[j].colQuantity));
                              strReplace.Replace("${PRICE}", Convert.ToString(query[j].colPrice));
                              strReplace.Replace("${TOTAL}", Convert.ToString(query[j].colAmount));
  
                          }
  </code></pre>