We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert HTML to PDF using C# in Web App is extremely slow | Aspose.PDF for .NET

I’m using the latest version of Aspose in a .NET/MVC 4 web application to convert HTML to PDF (HTML is a string) and it’s taking upwards of 30 seconds to convert. Here’s the code I’m using, and attached is the html and the resulting PDF.


// Applying license omitted for brevity
// the variable html is the input to the method and is a string
Aspose.Pdf.HtmlLoadOptions options = new Aspose.Pdf.HtmlLoadOptions();
options.UseNewConversionEngine = true;
options.InputEncoding = “UTF8”;

Aspose.Pdf.Document pdfDocument = null;
var bytes = System.Text.Encoding.UTF8.GetBytes(html);
using (var input = new System.IO.MemoryStream(bytes, false))
{
pdfDocument = new Aspose.Pdf.Document(input, options);
}

pdfDocument.Save(outputFileName, Aspose.Pdf.SaveFormat.Pdf);

Hi Bill,


Thanks for your inquiry. We have tested the scenario over Windows 7 64 bit, 8 GB RAM and Aspose.Pdf for .NET 9.3.0 and unable to notice the reported time. It is taking ~7 second at my end, we will appreciate if you please share a sample project to replicate the issue at our end for further investigation.

We are sorry for the inconvenience caused.

Best Regards,