Our application deals with word files.
We allow uploading of documents of upto 40mb in size
However certain features are restricted for documents under 300 pages only.
When a user uploads a document, at the server side I create a Document object using aspose and get page count as follows:
Document attachmentDoc = new Document(filePath);
int pageCount = attachmentDoc.getPageCount();
If the page count exceeds 300 pages, an alert is issued to the customer to notify him that certain features will be disabled.
Now, heres my issue:
Scenario1: When a very large file of around 1000 pages of plain text (size around 4mb) is uploaded, creating the document and getting the page count takes a very long time (close to 5 mins),which is unacceptable from a usability standpoint.
Scenario2: When a file with around 20 pages full of HD images (size around 30mb) is uploaded, the above code works very fast as expected.
Is there any way I can speed up this process for scenario1?