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.

Sun Jan 28, 2018 7:10 am

Hello Support Team,
I'm using Spire.Doc evaluation version( V6.1.17.4040). The doc file contains some fields. The code is as below,

Document doca = new Document(@"C:\Users\yf2017\A.docx", FileFormat.Docx);
Stream stream = new MemoryStream();
doca.SaveToStream(stream, FileFormat.Docx);
Document docb = new Document(stream, FileFormat.Docx);
docb.SaveToFile(@"C:\Users\yf2017\B.docx", FileFormat.Docx);

I found some proplems
1) the file size of B is smaller than the one of A
2) some fields in page are invisible. I think they are lost in calling SaveToStream().

Thanks in advanced.

yuqichun
 
Posts: 4
Joined: Sun Jan 28, 2018 6:45 am

Mon Jan 29, 2018 1:50 am

Hello yuqichun,

Thanks for your inquiry.
To help us reproduce the issue, could you please send your sample document to us(support@e-iceblue.com)? Don't worry, we will keep it confidential.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Jan 29, 2018 3:23 am

Hi Jane,
Thank you for you reply.
My workmate has got help from your workmate in QQ. The answer from your colleague is that the size of document will become smaller after calling SaveToStream, because some unnecessary contents will be eliminated. The file we tested is opened in Microsoft Word correctly. But It still be wrong while opened in PageOffice for Asp.Net , which is from another company.
I think that PageOffice can't support the Docx file which was processed in Spire.Docx ,although PageOffice can open Docx
created in Word well.
Fortunately, the problem has been solved. we use FielFormat.Doc intstead of FileFormat.Docx in calling SaveToStream to process document. It is opened in Pageoffice correctly.

Thank sincerely.

yuqichun
 
Posts: 4
Joined: Sun Jan 28, 2018 6:45 am

Mon Jan 29, 2018 5:54 am

Hi yuqichun,

Thank you for your valuable feedback.
Just feel free to contact us if you need any assistance.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Doc