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.

Wed Apr 18, 2012 2:53 pm

I am ecountering a problem with the spire.doc component. When my application runs , it simply opens a word document using the Document object of Spire.doc using the LoadFromFile method. When it encounters a word .doc document , it works well. It inserts an image and saves the file. However, when it tries to open a word .docx document, it does not work. It simply throws an exception that says : "Zip exception. Cant locate end of central directory record. Possible wrong file format or archive is corrupt."
I tried looking on the internet, however any thing that was somehow related did not help out in any way. Can you please help me?

SOSilvia
 
Posts: 1
Joined: Tue Apr 17, 2012 9:39 pm

Thu Apr 19, 2012 5:58 am

Hi ,

Thanks for your feedback and so sorry for the inconvenience caused by us.

We've created a research on this problem, but we can't reproduce it. Could you please offer more information(such as the related code and original docx file with the image)to help us resolve it. Thanks for your understanding and cooperation.

Have a great day!

Kind regards
Suvi
e-iceblue support
User avatar

Suvi.Wu
 
Posts: 154
Joined: Thu Oct 20, 2011 2:53 am

Tue Apr 24, 2018 10:07 am

Hi,
We are encountering exactly the same problem. We are using Spire.Doc Version 6.2.3.
I have attached the document and the error message that happens when we are downloading the document.
Hope you could help us.

Thanks and Regards,
Glo

gloria_delfin.ipi
 
Posts: 1
Joined: Mon Apr 23, 2018 8:19 am

Wed Apr 25, 2018 3:12 am

Hello,

Thanks for your contact.
Sorry we didn't find your attachment in this post, could you zip it and upload again? (or you could send it to support@e-iceblue.com ). Besides, at present the latest edition is Spire.Doc Version 6.4.5, please upgrade to this one and try again. If the issue still happens, we need your input document and full code to do better investigation.

Sincerely,
Lisa
E-iceblue support team
User avatar

lisali
 
Posts: 1
Joined: Wed Apr 18, 2018 7:31 am

Fri Apr 27, 2018 3:58 am

Hello,

Could you please let us know how is the issue going? Thanks in advance for your valuable feedback and time.
Have a nice day!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Tue Mar 24, 2020 2:16 pm

Hello Team,

We are using Spire doc library version 6.10.2.
We are getting one exception when writing word file.Below is the exception

spr?: Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.
at spr?.?(Stream A_0, Boolean A_1)
at spr?.?(Stream A_0, Document A_1)
at spr?.?(String A_0, Document A_1)
at Spire.Doc.Document.?(String A_0)
at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat)
at crm.Infrastructure.Template.Documents.WordGenerator.AppendToPdfDocument(List`1 newLetters, Boolean isLetterPrint, Nullable`1

We are not getting this exception every time also this issue is reproducible in production environment. We are not sure under what condition this issue is occurring as of now.
In production above error are logged.
Please can you help us what could be the cause or you have face issue earlier by any of the user

narendrab
 
Posts: 1
Joined: Tue Sep 04, 2018 10:17 am

Wed Mar 25, 2020 2:20 am

Hi Narendra,

Thanks for your inquiry.
To help us better look into your issue, please provide the following information. Thanks in advance for your assistance.
1) Your input file (if any), your full code or a runnable sample project that could reproduce your issue.
2) Your production environment information, such as OS information (E.g. Windows Server 2012, 64bit) and Region setting (E.g. China, Chinese).

Sincerely,
Rachel
E-iceblue support team
User avatar

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

Tue Apr 27, 2021 12:55 pm

We are also a commercial customer using Spire.XLS and we are experiencing the same problem with .xsls files (see attachment as an example)
IE-20191016.zip


Your assistance in getting this problem resolved would be much appreciated.

Code:

using (var memoryStream = new MemoryStream())
{
await myStream.CopyToAsync(memoryStream);

// Get Excel workbook ready
Workbook workbook = new Workbook();
workbook.LoadFromStream(memoryStream);

MemoryStream result = new MemoryStream();

// Iterate through all worksheets:
foreach (Worksheet s in workbook.Worksheets)
{
// Populate stream
s.SaveToStream(result, ";");

// Append text content from each worksheet to string
myText += Encoding.ASCII.GetString(result.ToArray());

}

return myText;
}


Stack trace:

Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt. at sprᜌ.ᜁ(Stream A_0, Boolean A_1) at spr។..ctor(XlsWorkbook A_0, Stream A_1, String A_2) at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Stream A_0, String A_1) at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Stream A_0, String A_1, ExcelVersion A_2, ExcelParseOptions A_3) at Spire.Xls.Core.Spreadsheet.XlsWorkbook..ctor(sprឌ A_0, Object A_1, Stream A_2, ExcelParseOptions A_3, ExcelVersion A_4) at sprឹ.ᜁ(Object A_0, Stream A_1, ExcelVersion A_2, ExcelParseOptions A_3) at spr᝱.ᜀ(Object A_0, Stream A_1, ExcelVersion A_2, ExcelParseOptions A_3) at sprᢅ.ᜀ(Stream A_0, ExcelVersion A_1, ExcelParseOptions A_2) at sprᢅ.ᜀ(Stream A_0, ExcelVersion A_1) at sprᢅ.ᜀ(Stream A_0) at Spire.Xls.Workbook.LoadFromStream(Stream stream)

The 'ᜏ' character, hexadecimal value 0x170F, cannot be included in a name.

martingp
 
Posts: 4
Joined: Sun Nov 29, 2020 12:56 pm

Tue Apr 27, 2021 1:18 pm

Ok so I got past the problem by upgrading from Spire Free to the latest Spire.Office via Nuget and specifying our commercial license key.

However now the content returned amounts to a couple question marks ?? using the above code - any help pin pointing the issue would be much appreciated.

martingp
 
Posts: 4
Joined: Sun Nov 29, 2020 12:56 pm

Wed Apr 28, 2021 8:10 am

Hello,

Thanks for your inquiry.
For your issue. please refer to the following modified code to set the encoding to UTF8. If you have any other questions, please feel free to contact us.
Code: Select all
                    ...
                    //s.SaveToStream(result, ";");
                    s.SaveToStream(result, ";", Encoding.UTF8);
                    //myText += Encoding.ASCII.GetString(result.ToArray());
                    myText += Encoding.UTF8.GetString(result.ToArray());
                    ...


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Apr 28, 2021 10:19 am

Thanks for your input however I'm still struggling to read the excel file attached in the previous post.

Are you able to read the file? and if yes can you provide the code you use?

Thanks!

martingp
 
Posts: 4
Joined: Sun Nov 29, 2020 12:56 pm

Thu Apr 29, 2021 3:48 am

Hello,

Thanks for your feedback.
I tried to load the file “IE-20191016.xlsx” you provided with the latest Spire.XLS Pack(Hotfix) Version:11.4.0, but I did not encounter any issue. Here I uploaded my test project, please run it directly on your side to see if the issue still occurs.

If there are still any issues, to help us further analyze, please provide your OS information (e.g. Win7 64bit) and region settings (e.g. China, Chinese). Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Sat May 08, 2021 7:16 am

Hello,

Have you run the project we provided to you? What is the result? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc

cron