@gayan1991
Thank you for sharing requested data.
We have modified your code snippet but exception is being thrown while loading your HTML document with Aspose.PDF for .NET 19.6. Would you please try below code with latest version and share your kind feedback with us.
HtmlLoadOptions options = new HtmlLoadOptions();
options.PageInfo.Margin.Top = 60;
options.PageInfo.Margin.Bottom = 60;
options.PageInfo.Margin.Left = 10;
options.PageInfo.Margin.Right = 10;
//options.PageInfo.IsLandscape = isLandscape;
options.PageInfo.IsLandscape = true;
var fileName = dataDir + "result.html";
string pdfFileName = dataDir + "result_19.6.pdf";
Document document = null;
using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(File.ReadAllText(fileName))))
try
{
document = new Document(ms, options);
}
catch (Exception e)
{
AlertFormationHelperEventSource.Current.ReportError(e);
}
try
{
foreach (Page p in document.Pages)
{
p.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
p.PageInfo.Margin.Bottom = 40;
}
document.ProcessParagraphs();
var optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions();
optimizationOptions.ImageCompressionOptions.CompressImages = true;
optimizationOptions.ImageCompressionOptions.ImageQuality = 50;
optimizationOptions.LinkDuplcateStreams = true;
optimizationOptions.RemoveUnusedObjects = true;
optimizationOptions.RemoveUnusedStreams = true;
document.OptimizeResources(optimizationOptions);
document.Save(pdfFileName);
}
catch (Exception ex)
{
AlertFormationHelperEventSource.Current.ReportError(ex);
}
Moreover, please note that support is offered via forums only so we are afraid any email address may not be shared. However, your colleague may follow up with us here in this thread.