I have an HTML content (extensive organization chart), the exported file does not correctly reflect the organization chart as it is shown on the screen, my code is the following
public static byte[] GenerarPDF()
{
Aspose.Pdf.HtmlLoadOptions htmlOptions = new Aspose.Pdf.HtmlLoadOptions(basePath);
htmlOptions.PageInfo.IsLandscape = true;
byte[] bytesResultado;
using (MemoryStream ms = new MemoryStream())
{
byte[] msLecturaHtml;
using (StreamWriter sr = new StreamWriter(ms))
{
sr.Write(HTML);
sr.Flush();
msLecturaHtml = ms.ToArray();
}
using (MemoryStream msLectura = new MemoryStream(msLecturaHtml))
{
using (Aspose.Pdf.Document doc = new Aspose.Pdf.Document(msLectura, htmlOptions))
{
using (MemoryStream msDestino = new MemoryStream())
{
doc.Save(msDestino, Aspose.Pdf.SaveFormat.Pdf);
bytesResultado = msDestino.ToArray();
}
}
}
}
htmlOptions = null;
return bytesResultado;
}
Attached HTML image and PDF