public MemoryStream GeneratePdfAspose(string html)
{
var outputStream = new MemoryStream();
var htmlLoadOptions = new HtmlLoadOptions();
htmlLoadOptions.PageInfo.Margin.Bottom = 30;
htmlLoadOptions.PageInfo.Margin.Top = 30;
htmlLoadOptions.PageInfo.Margin.Left = 5;
htmlLoadOptions.PageInfo.Margin.Right = 5;
using (var inputStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(html)))
{
using (var pdfDocument = new Document(inputStream, htmlLoadOptions))
{
pdfDocument.Save(outputStream);
}
}
return outputStream;
}
I am using the above code snippets to convert html to pdf. How am I going to include an external Unicode font to be embedded inside. some chinese characters are not rendered properly and appeared as square boxes.