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.

Thu Jun 27, 2019 5:08 pm

We sent sample documents to '[email protected]' today.Please provide feedback and solution asap.

Thanks
Haridhar

Haridhar_Spire
 
Posts: 12
Joined: Wed Jun 19, 2019 6:28 am

Fri Jun 28, 2019 1:35 am

As you requested to send the sample Doc files to replicate the issue,we sent sample documents to '[email protected]' today.Please provide feedback and solution asap.

Thanks

Haridhar_Spire
 
Posts: 12
Joined: Wed Jun 19, 2019 6:28 am

Fri Jun 28, 2019 2:16 am

Hello,

Thanks for sharing your sample documents.
I did reproduce the “OutOfMemory” exception when loading your two Word documents. The issue has been logged into our bug tracking system with a high priority. Once it is fixed or there is any update, I will let you know. Apologize for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Sat Jul 06, 2019 4:54 pm

Any update?

Thanks
Haridhar

Haridhar_Spire
 
Posts: 12
Joined: Wed Jun 19, 2019 6:28 am

Mon Jul 08, 2019 6:48 am

Hi,

Sorry for late reply as weekend.
When loading Word document, our Spire.Doc needs to unfold the document and analyzing the xml files. As I explained before, we found the size of document.xml reaches 483MB after unfolding your Word document. It is so big and there are more than 10000 pages. Even using Microsoft Word to load all pages, it is pretty slow. Our Dev team haven't found a good solution at present due to its complexity. We suggest that you don't make such large documents on your side. Sorry for the inconvenience and thanks for your understanding.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Mon Jul 08, 2019 5:06 pm

Thanks for the reply,

We got another issue, below code from spire samples to keep the header on first page only but it is not working for me.Can you please correct the code(if i did a mistake).

Document document1 = new Document();
document1.LoadFromFile(@"..\..\document1.docx");
Document document2 = new Document();
document2.LoadFromFile(@"..\..\document2.docx");
HeaderFooter header = document1.Sections[0].HeadersFooters.Header;
HeaderFooter firstPageHeader = document2.Sections[0].HeadersFooters.FirstPageHeader;

foreach (Section section in document2.Sections)
{
section.PageSetup.DifferentFirstPageHeaderFooter = true;
}

firstPageHeader.Paragraphs.Clear();
foreach (DocumentObject obj in header.ChildObjects)
{
firstPageHeader.ChildObjects.Add(obj.Clone());
}

document2.SaveToFile("Header.docx", FileFormat.Docx);

Thanks

Haridhar_Spire
 
Posts: 12
Joined: Wed Jun 19, 2019 6:28 am

Tue Jul 09, 2019 6:57 am

Hello,

Please refer to the following code to copy the header. If this is not what you want, please provide your input documents along with the desired output for a better reference. You can send them to us via email ([email protected]).
Code: Select all
Document document1 = new Document();
document1.LoadFromFile(@"document1.docx");

Document document2 = new Document();
document2.LoadFromFile(@"document2.docx");

HeaderFooter header = document1.Sections[0].HeadersFooters.Header;
document2.Sections[0].PageSetup.DifferentFirstPageHeaderFooter = true;
document2.Sections[0].HeadersFooters.FirstPageHeader.Paragraphs.Clear();

foreach (DocumentObject obj in header.ChildObjects)
{
    document2.Sections[0].HeadersFooters.FirstPageHeader.ChildObjects.Add(obj.Clone());
}

document2.SaveToFile("Header.docx", FileFormat.Docx2013);
Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Jul 12, 2019 6:02 am

Hi,

Greetings from E-iceblue!
Did my code work for you?
Thanks in advance for your valuable feedback and time.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc