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 Nov 28, 2014 4:30 pm

Hello,

I'm using Spire.Doc for .NET v5.2.76.4150 and trying to load word document with this code:
Code: Select all
Document document = new Document();
document.LoadFromFile(@"test2.docx", Spire.Doc.FileFormat.Docx);

But it thows exception:
Code: Select all
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Convert.ToDecimal(String value)
   at spr1983.13(XmlReader A_0, IDocumentObject A_1)
   at spr1983.6(XmlReader A_0, Table A_1)
   at spr1983.3(XmlReader A_0, TableCell A_1)
   at spr1983.2(XmlReader A_0, TableRow A_1)
   at spr1983.6(XmlReader A_0, Table A_1)
   at spr1983.14(XmlReader A_0, IDocumentObject A_1)
   at spr1983.13(Stream A_0)
   at spr1983.1(spr968 A_0)
   at spr1983.1(Document A_0)
   at spr1983.0(String A_0, Document A_1)
   at Spire.Doc.Document.13(String A_0)
   at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
   at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat)

You can find file in attachments

Sincerely,
Alexander

alexkr
 
Posts: 2
Joined: Thu Nov 20, 2014 12:19 pm

Mon Dec 01, 2014 3:56 am

Hello,

Sorry for late reply as weekend.
Thanks for your inquiry. It seems that you are using our Spire.Doc product for silverlight5 in the Spire.Office2.10, but in which there is no the LoadFromFile method. Please check what is your application, and then provide us the correct dll version information you used.
In addition, I have tried to load the document you provide with Spire.Doc for .Net, it works fine, there is no any exception.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Dec 01, 2014 11:39 am

Thank you for the quick reply.

I'm using trial version of Spire.Office v2.10 for .NET. Version of Spire.Doc dll - 5.2.76.4040 (dll location - C:\Program Files (x86)\e-iceblue\Spire.Office\Bin\NET4.0\Spire.Doc.dll).
Development environment - Windows 7 Professional 64-bit, MS Visual Studio 2010 Professional SP1.

In attachment you can find simple console application which produce loading file error.

Sincerely,
Alexander

alexkr
 
Posts: 2
Joined: Thu Nov 20, 2014 12:19 pm

Tue Dec 02, 2014 5:54 am

Hello,

Thanks for the information. Please set the culture of the thread as Invariant culture like as below.
Code: Select all
CultureInfo cc = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Document document = new Document();
document.LoadFromFile(@"..\..\Files\test.docx", FileFormat.Docx);
document.SaveToFile(@"..\..\Files\test.doc", FileFormat.Doc);
Thread.CurrentThread.CurrentCulture = cc;

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Dec 04, 2014 9:24 am

Hello,

Has your issue been resolved? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Apr 21, 2016 10:16 am

Hello,
I also got the same error when I convert word to epub.
Sometimes this error occurred, but not every time.
I had called this method,
document.LoadFromFile(fileName, Spire.Doc.FileFormat.Docx);
But in error show this method,
Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)


Error[
System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Single.Parse(String s, IFormatProvider provider)
at spr?.?(XmlReader A_0, TextBox A_1)
at spr?.?(XmlReader A_0, IDocumentObject A_1)
at spr?.?(XmlReader A_0, IDocumentObject A_1)
at spr?.?(MemoryStream A_0, MemoryStream A_1)
at spr?.?(XmlReader A_0, ParagraphItemCollection A_1, MemoryStream A_2)
at spr?.?(XmlReader A_0, ParagraphItemCollection A_1)
at spr?.?(XmlReader A_0, ParagraphItemCollection A_1)
at spr?.?(XmlReader A_0, IDocumentObject A_1)
at spr?.?(Stream A_0)
at spr?.?(spr? A_0)
at spr?.?(Document A_0)
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)]

mahesh.ingole123@gmail.com
 
Posts: 6
Joined: Thu Oct 01, 2015 9:57 am

Fri Apr 22, 2016 5:58 am

Hi,

Thanks for your feedback.
Could you share your word document with us for investigation? If it is not available, you can send it to our email (support@e-iceblue.com).

Thank you and Best Regards,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Thu Apr 28, 2016 6:32 am

Hello,

Has your issue been resolved?
Could you please give us some feedback?

Thanks and Best Regards,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri Feb 23, 2018 11:16 am

Hi, I am using spire.doc 7.9, but I am getting error in loading a word doc .docx

System.ArgumentNullException: Value cannot be null.
Parameter name: fontName

please help.

abc1234
 
Posts: 2
Joined: Fri Feb 23, 2018 7:45 am

Fri Feb 23, 2018 11:17 am

Hi, I am using spire.doc 7.9, but I am getting error in loading a word doc .docx

System.ArgumentNullException: Value cannot be null.
Parameter name: fontName

please help.

abc1234
 
Posts: 2
Joined: Fri Feb 23, 2018 7:45 am

Sat Feb 24, 2018 1:35 am

Hello,

Thanks for your inquiry.
Firstly i advise you to use the latest Spire.Doc Pack(hot fix) Version:6.2.3 to have a test. If the issue still exists, please provide your input Word documents which can reproduce the issue to help us investigate it. You could send them to us via email support@e-iceblue.com.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Tue Feb 27, 2018 9:27 am

Hello,

Greetings from E-iceblue.
Have you tested the latest hotfix? How is your issue now?
Thanks in advance for your valuable feedback and time.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Wed Mar 07, 2018 4:28 pm

I have the same problem. The hotfix did not solve it.

In my case the problem was the file I was trying to open was a .docx - probably too new.
I saved it as a .doc and it opened fine.

The error message was not helpful in determining the actual reason for failure.

mohnston
 
Posts: 1
Joined: Mon Mar 05, 2018 9:00 pm

Thu Mar 08, 2018 1:40 am

Dear mohnston,

Thanks for your inquiry.
Could you please share us with your .docx file? We will look into it and provide a solution accordingly. You could send it to us via email support@e-iceblue.com. Many thanks.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Return to Spire.Doc