title: marathi PDF using iTextSharp
body: <p>I am try to create marathi PDF using <strong>iTextSharp</strong> PDF is created successfully but marathi text are improper  </p>
  
  <p>expecting result अंदाजपत्रकातील तरतूद व खर्च
  but getting data  अंदाजपत् रकातील तरतुद व खरच</p>
  
  <p><strong>code</strong></p>
  
  <pre><code>public void pdf() {
     string pdfFileName = Request.PhysicalApplicationPath + "\\PDF\\" + "GenerateHTMLTOPDF.pdf";
     FileStream fs = new FileStream(pdfFileName, FileMode.Create);
     Document doc = new Document(PageSize.LETTER);
     PdfWriter writer = PdfWriter.GetInstance(doc, fs);           
     doc.Open();
     //Path to our font            
     string mangalTff = Request.PhysicalApplicationPath + "\\font\\" + "mangal.ttf";
     //Register the font with iTextSharp
     iTextSharp.text.FontFactory.Register(mangalTff);
     //Create a new stylesheet
     iTextSharp.text.html.simpleparser.StyleSheet ST = new iTextSharp.text.html.simpleparser.StyleSheet();
     //Set the default body font to our registered font's internal name           
     ST.LoadTagStyle(HtmlTags.BODY, HtmlTags.FACE, "mangal");
     //Set the default encoding to support Unicode characters
     ST.LoadTagStyle(HtmlTags.BODY, HtmlTags.ENCODING, BaseFont.IDENTITY_H);           
     //Parse our HTML using the stylesheet created above
     string htmlDisplayText = Convert.ToString(HTMLReport());
     htmlDisplayText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Unicode, Encoding.Unicode, Encoding.UTF8.GetBytes(htmlDisplayText)));// html 
     List&lt;IElement&gt; list = HTMLWorker.ParseToList(new StringReader(htmlDisplayText), ST);           
    //Loop through each element, don't bother wrapping in P tags
    foreach (var element in list){
        doc.Add(element);
    }
    doc.Close();
    Response.ContentType = "application/x-download";
    Response.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}\"", "GenerateHTMLTOPDF.pdf"));
    Response.ContentEncoding = Encoding.UTF8;
    Response.WriteFile(pdfFileName);
    Response.HeaderEncoding = Encoding.UTF8;
    Response.Flush();
    Response.End();
   }
  </code></pre>
  
  <p>advance thank you</p>