You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add custom font family and font weight in the inline html. But I couldn't able to see any changes in the generated pdf.
var htmlContent = <div> <div style='font-family: fantasy; font-weight: 600;'>36</div> </div>;
PdfDocument pdfDoc = new PdfDocument();
PdfGenerator.AddPdfPages(pdfDoc, htmlContent, PageSize.A4);
using (MemoryStream ms = new MemoryStream())
{
pdfDoc.Save(ms);
response = ms.ToArray();
string fileName = "D:\downloads\pdf\" + DateTime.Now.Ticks + ".pdf";
File.WriteAllBytes(fileName, response);
}
In the above code. I'm trying to convert html to pdf and save in my local machine. But the resulted pdf doesn't applied font-family and font-weight.
Can anyone help me to sort out the issue? Is there any documentation or example for how to use custom font family (ex: Fantasy)?
The text was updated successfully, but these errors were encountered:
I'm trying to add custom font family and font weight in the inline html. But I couldn't able to see any changes in the generated pdf.
var htmlContent =
<div> <div style='font-family: fantasy; font-weight: 600;'>36</div> </div>
;PdfDocument pdfDoc = new PdfDocument();
PdfGenerator.AddPdfPages(pdfDoc, htmlContent, PageSize.A4);
using (MemoryStream ms = new MemoryStream())
{
pdfDoc.Save(ms);
response = ms.ToArray();
string fileName = "D:\downloads\pdf\" + DateTime.Now.Ticks + ".pdf";
File.WriteAllBytes(fileName, response);
}
In the above code. I'm trying to convert html to pdf and save in my local machine. But the resulted pdf doesn't applied font-family and font-weight.
Can anyone help me to sort out the issue? Is there any documentation or example for how to use custom font family (ex: Fantasy)?
The text was updated successfully, but these errors were encountered: