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 Aug 27, 2014 9:26 am

I am trying to open a document basing on html file, but i have the error : 'Content-Type' is an unexpected token. The expected token is '"' or '''. Line 1, position 127.

tarikzaid
 
Posts: 29
Joined: Wed Aug 06, 2014 7:16 am

Wed Aug 27, 2014 9:40 am

Hello,

Thanks for your feedback.
Please attach your html file and codes here for our testing, or you can send it to our Email(support@e-iceblue.com).
Thanks,
Gary
E-iceblue support team
User avatar

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

Wed Aug 27, 2014 12:10 pm

Thanks for reply.
I attached the html document.

The code is

document.LoadFromFile(srcfilename,FileFormat.Html,XHTMLValidationType.None);

The srrfilename is the file attached.

Thanks!
Last edited by tarikzaid on Mon Nov 03, 2014 9:41 am, edited 1 time in total.

tarikzaid
 
Posts: 29
Joined: Wed Aug 06, 2014 7:16 am

Thu Aug 28, 2014 2:39 am

Hello,

Thanks for your response.
We have tested it with the newest hotfix, it works fine, please download the hotfix( Spire.Doc Pack(hot fix) Version:5.2.29) and try it again.
Code: Select all
Document doc = new Document();
doc.LoadFromFile("MQS_BK_20140822-091307#002.html", FileFormat.Html, Spire.Doc.Documents.XHTMLValidationType.None);
doc.SaveToFile("result.docx",FileFormat.Docx);

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 Aug 28, 2014 11:37 am

Hello, thank you for your response.

I did the necessary with the new hotfix. I have an other error "input string was not in a coorect format.".

The code is the same.

Can you check please ?

tarikzaid
 
Posts: 29
Joined: Wed Aug 06, 2014 7:16 am

Fri Aug 29, 2014 2:16 am

Hello,

Thanks for your response.
I suspect the issue is caused by the culture, our product only works in invariant culture. The following codes is for your reference.
Code: Select all
CultureInfo cc = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Document doc = new Document();
doc.LoadFromFile(@"..\..\MQS_BK_20140822-091307#002.html", FileFormat.Html, Spire.Doc.Documents.XHTMLValidationType.None);
doc.SaveToFile(@"..\..\result.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

Wed Sep 03, 2014 9:03 am

Hello,

Has the issue been resolved? Could you please give us some feedback if convenienc?

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

Return to Spire.Doc