Performances of Loading and Printing

Hello !

I’ve read a lot of posts on this forum about the performances of loading and printing a document. First call is slow because Aspose needs to load a lot of stuff like internal resources and fonts, then second call is faster.

How can I manage to force Aspose to load all the internal stuff and caches before making that first call ?
I have a time window during the load of my program where I could “pre-load” Aspose.
My goal is to overcome or at least match the performances of Word on the first print call.

I tried caching PrinterSettings, creating a new Document (with empty content) but I still have a difference between first and further calls.

Is there anything I can do ?

Thanks in advance.

@bucherb sorry, but Aspose.Words API don’t have any built in mechanism to preload resources, the resource loading happen when the document is load by first time. You can add custom behavior to the loading process by implementing the interface IResourceLoadingCallback.

@eduardo.canal I’m not refering to the resources of the document itself, wich IResourceLoadingCallback is made for, but for the internal resources of Aspose.

Is there any way I could print on a virtual “fake” printer to make sure Aspose has loaded all of it’s internal resources and fonts ?

@bucherb You are right, on the first call Aspose.Words inits static resources, which are then reused on the subsequent calls. You can create an empty document and save it as PDF, for example, on your application start to force Aspose.Words to init resources to avoid “cold” start on the real requests.

FYI @eduardo.canal

1 Like