I am working on the Aspose.Pdf library (version 11.3.0.0) to convert html to pdf.
The result in pdf looks really nice, but the conversion is very slow.
Depending on the size of the html it takes about 7 seconds to generate 1 pdf (on 1 thread).
The code we use to convert it to html:
private static void CreatePdf()
{
Aspose.Pdf.License pdflicense = new Aspose.Pdf.License();
pdflicense.SetLicense(@“Aspose.Pdf.lic”);
pdflicense.Embedded = true;
Stopwatch sw = new Stopwatch();
sw.Start();
HtmlLoadOptions hlo = new HtmlLoadOptions();
hlo.PageInfo.Margin.Left = 20;
hlo.PageInfo.Margin.Top = 10;
hlo.PageInfo.Margin.Right = 15;
hlo.PageInfo.Margin.Bottom = 30;
Document doc = new Document(“Form_2.html”, hlo);
Page p = doc.Pages[2];
p.PageInfo.Margin.Top = 0;
p.PageInfo.Margin.Bottom = 0;
p.PageInfo.Margin.Left = 10;
p.PageInfo.Margin.Right = 0;
doc.Save(“Pdf\output.pdf”);
Console.WriteLine($“Ellapsed {sw.ElapsedMilliseconds} ms”);
sw.Stop();
}
Do you know if there is a way to increase this performance?