Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Jun 26, 2020 1:08 pm

I am beginner in Spire.Doc and just making sure whether the Free version of Spire.Doc component fulfill the requirements which i needed or not.

I am dealing with large text contents for export to word file and for the same, i have choose Spire.Doc.Document to complete that.
But, while saving the Spire.Doc.Document to .docx file using SaveToFile() API getting the exception of type 'System.OutOfMemoryException' from the ASP.NET Core 3.1 web running on IIS.

The contents that i am exporting to the word file contains huge amount of data approximate 55 lakhs of characters and may be more in my requirement.

Here, help would be more appreciated!!!

Ashish_Bhalodiya
 
Posts: 2
Joined: Fri Jun 26, 2020 12:37 pm

Mon Jun 29, 2020 3:20 am

Hello,

Thanks for using our products.
To help us further investigate your issue, please provide the following information.

1) You full test code and some sample Word files that could reproduce your issue.
2) Your OS information (E.g. Windows 7, 64 bit) and region setting (E.g. China, Chinese).

You could send them to us(support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Tue Jun 30, 2020 2:05 pm

Thanks for quick reply,

I have seen that while saving the document into .docx file with large contents (approximate 55 lakh of characters) this issue is occurred.

I want to use a trick to append only 5 lakh of characters to the document initially and save the document as .docx file.

Again, load the saved .docx file into document object and append next 5 lakh characters into it.

Repeat this process up to end of contents.

To do this, i need to save .docx file every time after appending the characters into document.

Can i append characters into loaded document object without saving it into .docx file???

Please provide your feed back.

Ashish_Bhalodiya
 
Posts: 2
Joined: Fri Jun 26, 2020 12:37 pm

Wed Jul 01, 2020 9:08 am

Hello,

Thanks for your response.
Did you encounter this issue while testing locally? And according to your description, I used the following code to append about 55 lakh characters to a Word document, but did not encounter any issue. If the code you used is different from mine, please share your full code and the text contents you used to help us investigate further. Besides, I also suggest you use our commercial version (the latest version is Spire.Doc Pack(hot fix) Version:8.6.3) to test your case since it is more stable and contains more bug fixes than the free version. Looking forward to your further feedback.
Code: Select all
    Document doc = new Document();
    Section sec = doc.AddSection();
    for (int i = 0; i < 11; i++)
    {
        Paragraph para = sec.AddParagraph();
        //Append 5 lakh characters
        para.AppendText("5 lakh characters");
    }
    doc.SaveToFile("out.docx");


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc