Slow Performance About Html To Pdf in .net Core 2.1


Hi ,

I have 150 KB html file and we want to generate pdf and get pdf bytes , but its very slow to creating Document class and increasing the document size (150KB to 340 KB) after converting to PDF.

i have another scenario another html tags to converting to PDF but just only “<p>Hello World</p>” and converting to pdf.The output pdf size is 28 KB.

I think it’s so high.

So how can i manage with this ?

Thank you , best regards.


       string html = "<p>Hello World!</p>";

        byte[] bytes = UTF8Encoding.UTF8.GetBytes(html);

        HtmlLoadOptions options = new HtmlLoadOptions();
        Document document = new Document(new MemoryStream(bytes), options);
        Aspose.Pdf.Optimization.OptimizationOptions optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions
            RemoveUnusedObjects = true,
            RemoveUnusedStreams = true,.
            AllowReusePageContent = true,
        MemoryStream memoryStream = new MemoryStream();
        document.Save(memoryStream, SaveFormat.Pdf);



Thanks for your inquiry.

Please note that Aspose.PDF API loads different resources into memory (when program launches first time) which need to be used most and frequently during processing of document. Which is why you will notice significant difference of time consumption between multiple runs of a program.

We have also tested the scenario in our environment where you code took 28 seconds for the first launch and subsequent running of same code took only ~7 seconds.

As far as the size of output document concerned, we have logged an investigation ticket in our issue tracking system as PDFNET-46292. We will definitely investigate the issue and keep you posted with the status of ticket resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.


Thank you @asad.ali ,

I think 7 seconds is to much to converting because it’s just write to Hello World :relaxed: .Our company recently buy the license(Site Small Business).
So this case urgent for our side.

We’re waiting.



Thanks for sharing your feedback.

Your concerns about total time taken by conversion process have been logged under a separate ticket i.e. PDFNET-46297. We will also investigate this logged ticket and share our feedback with your as soon as we investigate it. Please spare us little time.

We are sorry for the inconvenience.


Dear Asad,

Any progress with the issue, if it will take too much time to be solved, we want to cancel the licence. Please inform us asap.




Please note that issues have recently been logged in our issue tracking system and still pending for analysis. The issues under free support model are resolved on first come first serve basis and your issues will definitely be investigated and resolved after we fix other issues which were logged prior to yours.

Furthermore, we have logged your concerns as well and will definitely consider them during investigation. We will surely let you know as soon as some significant progress is made towards issue resolution. We greatly appreciate your patience in this regard.

We are sorry for the inconvenience.


@asad.ali Hi ,

Any update for this situtation ? we opened this bug in 19 days ago and we’re waiting for the solution.

Our company getting loss…




We are afraid to share the earlier logged tickets are not yet resolved due to other high priority issues. However, please note that, we do understand the severity of the issues for you and will definitely investigate/resolve them as per the schedule. We really appreciate your patience and comprehension in this regard. Please spare us little time.

We are sorry for the inconvenience.


@asad.ali hi ,

It’s been long time :slight_smile: Any updates for this situation ? If any update or solutions dont come , we sadly cancel our license for this product.

Regards ,



We would like to share with you that investigation against your issue is underway and as soon as it is complete, we will be in position to share an ETA for resolution. We greatly appreciate your patience and comprehension in this regard. Please spare us little time.

We are sorry for the inconvenience.


The issues you have found earlier (filed as PDFNET-46292) have been fixed in Aspose.PDF for .NET 19.8.