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

Free Support Forum - aspose.com

Page count performance issue

Hi there,

I am experiencing a performance issue with page count property. I’ve attached my sample code for you to review.

I have a main docx file which is just 1 page empty doc, then I need to convert an xml file and merge it with the main docx, the output becomes new main docx, then convert same xml file again and merge with new main docx. so the final output would be main docx + first converted xml + second converted xml.
After adding each xml file to main doc, I called mainDoc.PageCount property and timed it.
after adding first xml file to main doc, the page count was 402, and it took 24 minutes to get this number.
after adding second xml file to main doc, the page count was 803, and it took 49 minutes.
this was way too long and not acceptable for my application.

I created a text file which has exact the same number of characters as the xml file and repeated the test.
first page count was 350 and it took 30 seconds, second page count was 699 and it took 1 minute. still pretty long for a simple property but it’s acceptable.

Could you have your dev take a look?


Hi Hui,

Thanks for your inquiry.

After an initial test with Aspose.Words for .NET 17.3.0, we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:

Pleas also see attached screenshot.

Best regards,

I tried with 17.3, it indeed improved a lot, however, its still slow for a simple property call, first one took 1:00, 2nd one took 2:10, see attached screenshot, your readings are slightly faster.
is this a reasonable results for a 402/803 page document?

Hi Hui,

Thanks for your inquiry. For the sake of any correction, we have logged this problem in our issue tracking system as WORDSNET-15023. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for any inconvenience.

Please also tell us the details of the machine environment you're getting this problem on e.g. the operating system version, its architecture (32 / 64 bit), .NET Framework version and what DLL of Aspose.Words are you using? (the one that resides in net2.0 or in net3.5_ClientProfile or in net4.0 or in net4.0_ClientProfile folder).

Best regards,

My dev computer is Dell Precision T3610 Intel Xeon CPU E5-1620 v2 @3.7GHz 3.70GHz
8.00G installed RAM, 64-bit Operating System
.NET 4.6 installed. Aspose DLL was copied from net4.0 folder and application build target is .net 4.0
if you need more information just let me know.
Thanks for helping me out

Hi Hui,

Thanks for the additional information. We will keep you posted on further updates.

Best regards,

Hi Hui,

It is to update you that our product team has completed the analysis and the root cause of this issue has been identified. The problem here is that appended document comprises of a single Paragraph of 1395 K characters.

Aspose.Words currently struggles to process such huge Paragraphs. It is a known performance issue.

To workaround this problem you need to separate text with Paragraph breaks. Hope, this helps.

We will inform you as soon as this issue is resolved.

Best regards,

Thanks for the tip, I’ll try that out, please keep me posted