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

Free Support Forum - aspose.com

Problem with converting very large doc files

Hi,

I use Aspose.Words for converting large word documents
My code is very simple:

Aspose.Words.Saving.SaveOptions saveOption = new Aspose.Words.Saving.XpsSaveOptions();
Document doc = new Document(documentStream);
doc.Save(resultStream, saveOption);

I didn’t have success with converting file in attachment. I wait more than 80 minutes but no success.

How can I decrease the time of converting, optimize conversion, maybe I should split document into several parts, and then merge converted pieces ?

Thanks

Hi
Roman,


Thanks for your inquiry.

Yes, I managed to reproduce the OutOfMemoryException upon converting your Word file to XPS. Probably the document you are trying to convert to XPS is simply too large. When you render a document Aspose.Words needs to build two model in the memory – one for document and the other for rendered document. That is why Aspose.Words utilizes more memory when you render a document than when you simply save a document in flow formats.

Secondly, yes, it is always better to use few small documents instead of one huge document.

Please let me know if I can be of any further assistance.

Best Regards,

Thanks for answer,

Does Aspose provide ability to divide one large Document object into several smaller and after conversion of each, somehow concatenate into one ?
What it is your recommendation, how can I convert this large document during reasonable time ?

Regards,
Roman

Hi Roman,


Thanks for your inquiry and sorry for the delayed response. Since your Word document has only one section, may be in your case, you can split it based on Paragraphs, for example, you can create smaller sub documents per 500 Paragraphs.

Once, you have generated sub documents, save them individually to PDF format by using Aspose.Words. After generating multiple PDF documents you can merge these documents together into one by using Aspose.Pdf.Kit. Once you have a combined PDF, you can convert it to XPS again by using Aspose.Pdf.Kit.

I hope, this will help.

Best Regards,