I’m using Aspose.PDF 23.4 .net library to convert HTML to PDF format. However, I found out the generated content has missing information, which is replaced with a blank page in the middle
problem.zip (177.9 KB)
I’ve attached the zip file shown above, which includes the generated pdf file and also the base html file for conversion.
Note that I’ve used the following code for memorystream output:
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;
}