Pdf pdfObject = new Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Generator.Section section = pdfObject.Sections.Add();
// Read the contents of HTML file into StreamReader object
StreamReader r = File.OpenText(source);
//Create text paragraphs containing HTML text
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
// enable the property to display HTML contents within their own formatting
text2.IsHtmlTagSupported = true;
//Add the text paragraphs containing HTML text to the section
// Set the Font of Section as “Arial Unicode MS”, modified to support Unicode support
text2.TextInfo.FontName = “Arial Unicode MS”;
// Set the font size of the section as 9
text2.TextInfo.FontSize = 9;
// If you need to display all the text in Olive Color
text2.TextInfo.Color = new Aspose.Pdf.Generator.Color(“Olive”);
// Add the text object containing HTML contents to PD Sections
section.Paragraphs.Add(text2);
// Specify the URL which serves as images database
pdfObject.HtmlInfo.ImgUrl = source.Substring(0, source.LastIndexOf(’\’));
//Setting the unicode support.
pdfObject.SetUnicode();
//Save the pdf document
pdfObject.Save(destination);
Also, If I change the font-family to Arial , its generating the PDF but the layout of the PDF is not proper.
Please guide me.