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.

Tue Jun 12, 2018 12:18 pm

Hello,

we were using Spire Doc Free to generate word documents (FileFormat.Docx2013).
The generated documents were Office Open XML compliant.

However, after purchasing Spire Doc Standard the same documents aren't Office Open XML compliant anymore.

Could you please give us some explanations:
- are we using wrong file type?
- are we using the wrong licence?
- or your product isn't Office Open XML compliant

Thank you in advance.

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Wed Jun 13, 2018 2:57 am

Dear Evelyne WEHRLE,

Thanks for your inquiry.
In order to help us investigate further, please provide the input document, the two result files generated by Free version and standard version and the entire code you were using.

Many thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jun 13, 2018 9:56 am

Hello,

please notice that all files and code in this post are highly confidential and must not be made public!

-the template document is: TPL_W007_TVA_NORMALE.docx

-the document generated using trial version is: ContratSurInternetFinal.docx

-the document generated using spire doc standard is: unsigned contrat (2).docx


You can use the simplified code here below to observe the issue:

Document doc = new Document();
using (MemoryStream ms = new MemoryStream(File.ReadAllBytes("path")))
{
doc.LoadFromStream(ms, FileFormat.Docx2013);
}


doc.SaveToFile(savePath, FileFormat.Docx2013);

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Wed Jun 13, 2018 10:50 am

Dear Evelyne WEHRLE,

Many thanks for your information. We will look into the issue and keep you informed about the progress.

We always keep customer's document confidential. Now I have downloaded your files, you could delete it here. Moreover, you could provide the files to us(support@e-iceblue.com) via email next time.

Besides, I have tested your case with Spire.Doc for .NET Standard Edition Version:6.1, did you use same version ? Then I got different result file from yours, the xml tags in it were a little different, hence could you please point out where has issues in your file ? And what is the free version you used ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jun 13, 2018 12:11 pm

Hello Betsy,

the code I've provided does not generate exact the same files as those I attached.
In the files I've attached you can see that the content of the docx cabinet isn't the same, there is the folder [trash] when using Spire Doc Standard.

However when you use the code I've sent you will obtain the same issue:
-when using Spire Trial the generated document is Office Open XML compliant,
-but when using Spire Doc Standard the generated document isn't OOXML compliant.

Unfortunately I can't sent you the entire code because it is confidential.

The versions used are the latest that I could find on your site:
Spire Doc standard V6.1.0.40040
Spite Doc Trial V6.3 (visual studio nugget package)

Thank you.

Sinceerely,
Evelyne.

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Thu Jun 14, 2018 3:33 am

Dear Evelyne,

Thanks again for your information.
As I said before, I got different result on my side, and I found my result file didn't has the folder [trash]. I did more testing using your code and files on multiple machines, unfortunately, cannot reproduce your issue. I sent my sample project(includes result file in it) to you via email, please have a check, and tell us if you could get correct result.

Besides, after checking your original file "TPL_W007_TVA_NORMALE.docx", we found there was no folder [trash] while the result file "unsigned contrat (2).docx" generated by Spire Doc Standard has it and there was extra folder customXml which is not existed in original file, that means you did something else via Spire. We guess the folder [trash] was generated by your other operation. It is very difficult for us to fix your issue if we don't duplicate your issue on our side. Please share us following information.
1. Sample project for showing your issue.
2. The OS and Region information, e.g, Win7 64bit, China/Chinese.

Moreover, we have deleted your files in your previous post for avoiding others downloading your files.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Jun 14, 2018 9:51 am

Hello,

thank you for your answer and your actions.

We will conduct actions in order to generate the document with 2 dlls and entire code.

I'll give you feedback once we have all elements.

Sincerely,
Evelyne.

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Thu Jun 14, 2018 9:58 am

Dear Evelyne,

I am looking forward to your feedback.
Have a nice day:)

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jun 15, 2018 9:31 am

Hello Betsy,

I have all elements now, I will send the files to your mail address:
- template file: TPL_W007_TVA_NORMALE_begin.docx
- file generated with trial version:TPL_W007_TVA_NORMALE_end_unmod_trl.docx
- file generated with standard version:TPL_W007_TVA_NORMALE_end_unmod_std.docx

The code C# I've used:

var loadPath = @"";
var savePathUnmodified = @"";

try
{
Document doc = new Document();

using (MemoryStream ms = new MemoryStream(File.ReadAllBytes(loadPath)))
{
doc.LoadFromStream(ms, FileFormat.Docx2013);

doc.SaveToFile(savePathUnmodified, FileFormat.Docx2013);
}
}
catch (Exception ex)
{
throw;
}

The file "TPL_W007_TVA_NORMALE_end_unmod_trl.docx" is OOXML compliant, however the file "TPL_W007_TVA_NORMALE_end_unmod_std.docx" isn't OOXML compliant.

To check OOXML compliancy we are opening files in Gmail.

Thank you.

Kind Regards,
Petar STANIC.

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Fri Jun 15, 2018 10:35 am

Dear Petar,

Thanks for your information.
I opened the result files via gmail, and found the file generated by standard version cannot be opened successfully, yet the file generated by free version could be opened. Because of this, so you said standard version isn't OOXML compliant, right ? If not, please indicate where is not OOXML compliant.
We will look into the issue the file cannot be opened in Gmail, and keep you informed about the process.

Many thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jun 15, 2018 1:56 pm

Dear Betsy,

Openning file in Gmail is our quick way to check if the document is OOXML valid.

Our use case is : when the docx file is generated we are sending it to our partners WebApi which is using OpenXML SDK for Office.
They cannot open the file generated with Spire Doc Standard, the error is : « Cannot load the root element from the part. The part contains invalid data. »
They have not trouble opening the document generated with trial version.

So clearly there is mismatch in compatibility between trial and standard version of Spire Doc.

Regards,
Petar

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Fri Jun 15, 2018 1:57 pm

Dear Betsy,

Here is the complete error message that our partener is getting when trying to open the document :
« The root XML element "http://purl.oclc.org/ooxml/wordprocessingml/main:document" in the part is incorrect. The expected root XML element is: "http://schemas.openxmlformats.org/wordprocessingml/2006/main:document". »

Hope this help.

Regards,
Petar

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Mon Jun 18, 2018 4:06 am

Hello,

Thank you for sharing the details.
I searched the Internet and found that the first xml element is the OOXML strict type while the second form is OOXML transitional. Our dev team would investigate it further and I would update you ASAP.

Sincerely,
Jane
E-iceblue support team
User avatar

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

Tue Jun 19, 2018 3:53 am

Hi Petar,

After our dev team in-depth investigation, they got the cause and workaround.
We should not say that the generated file is not OOXML-compliant because the file could be successfully opened in MS Word. The issue occurs because the standard that the Open XML SDK uses is different from that Spire.Doc uses, and we are using the "ECMA-376, 4th Edition" preference. To avoid it, you could change the output file format to be Word2010 instead.
Code: Select all
var loadPath = @"TPL_W007_TVA_NORMALE_begin.docx";
var savePathUnmodified = @"TPL_W007_TVA_NORMALE_se.docx";
try
{
    Document doc = new Document();

    using (MemoryStream ms = new MemoryStream(File.ReadAllBytes(loadPath)))
    {
        doc.LoadFromStream(ms, FileFormat.Docx2013);

        doc.SaveToFile(savePathUnmodified, FileFormat.Docx2010);
    }
}
catch (Exception ex)
{
    throw;
}


Sincerely,
Jane
E-iceblue support team
User avatar

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

Tue Jun 19, 2018 7:14 am

Dear Jane,

thank you for your answer and your actions.

I am asking myself about the implications of the proposed solution?
Will the document keep the functionalities of Word 2013/2016 version or it will get regressed to Word 2010?

Unfortunately, the way I see it is that the Spire Doc Standard isn't OOXML compliant for modern docx versions for the moment. The generated document cannot be opened neither by Office Open XML SDK nor Google Documents. MS Word is the unique program that opens generated document.

Hope to see this compliancy soon.

Best Regards,
Petar.

Evelyne WEHRLE
 
Posts: 8
Joined: Tue Jun 05, 2018 3:35 pm

Return to Spire.Doc