Hi,
I am trying to convert a html string which contains the devanagri text to a pdf file using EO.PDF. The font that I am using in my html is named 'k010_0.TTF' While debugging, the html string is created correctly but as soon as the html is convert to html the text changes.
Am I missing anything while adding a new font in PDF.
What I have tried:
The following is my html string:-
<html>
<head>
<title></title>
<style type="text/css">
.style1
{
font-family: "Kruti Dev 010";
}
</style>
</head>
<body>
<table width="100%">
<tbody>
<tr>
<td class="style1">fsdfsdfsdfsdfdsf</td>
</tr>
<tr><td></td></tr>
<tr>
<td align="center" class="style4"><img src="##Offer_Details.InspirePath##" style="position: static" /></td>
</tr>
</tbody>
</table>
</body>
</html>
And the following is my code for calling the EO.Pdf function
ConvertHtml()
public static void HTMLStringToPdf_EO(string strhtml, string fileDisplayName)
{
HttpResponse response = HttpContext.Current.Response;
response.ClearContent();
response.AddHeader("content-disposition", "attachment; filename=" + fileDisplayName + ".pdf");
response.ContentType = "application/pdf";
HtmlToPdfOptions options = new HtmlToPdfOptions();
if (!String.IsNullOrEmpty(headerText))
options.HeaderHtmlFormat = headerText;
if (!String.IsNullOrEmpty(footerText))
options.FooterHtmlFormat = footerText;
options.OutputArea = new RectangleF(0.5f, 0.5f, 9f, 12f);
options.PageSize = PdfPageSizes.B4;
options.FooterHtmlFormat += "<div style='clear:both;'></div><br/><div style='text-align:left; float:left;'>" + DateTime.Now.ToString("dd/MM/yyyy HH:mm") + "</div>";
options.FooterHtmlFormat += "<div style='text-align:right; float:right;'>" + "Page {page_number} of {total_pages}" + "</div>";
HtmlToPdf.ConvertHtml(strhtml, response.OutputStream, options);
headerText = string.Empty;
footerText = string.Empty;
}