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 Jan 17, 2018 11:28 am

Hello Support Team,

is there a way to create html from an Section object?
I did the following workaround. But that, of course, generates a complete html page.

Code: Select all
   
            Section section = ....
            var doc = new Spire.Doc.Document();
            doc.Sections.Add(section.Clone());
            var ms = new MemoryStream();
            doc.SaveToStream(ms, FileFormat.Html);
            var result = new byte[ms.Length];
            ms.Write(result,0, (int)ms.Length);
            var html = Encoding.UTF8.GetString(ms.ToArray());


Best regards,
Arne

arne.weber@webtelligence.net
 
Posts: 19
Joined: Mon Sep 19, 2016 6:52 am

Thu Jan 18, 2018 3:12 am

Hello,

Thanks for your inquiry.
After an initial test with the latest hotfix(Spire.Doc Pack(hot fix) Version:6.1.6), I could successfully convert the content of a section to HTML file using your code. Please upgrade your dlls first. If the issue still troubles you, please send your sample document to us(support@e-iceblue.com).

Sincerely,
Jane
E-iceblue support team
User avatar

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

Fri Jan 19, 2018 6:35 am

Hello Jane,

yes, the sample code works, for me too :)
But is there a way to just get the sections html (without <html>, <body> ... etc.)?

Best regards,
Arne

arne.weber@webtelligence.net
 
Posts: 19
Joined: Mon Sep 19, 2016 6:52 am

Fri Jan 19, 2018 9:05 am

Hello Arne,

Thanks for your feedback. I am sorry Spire.Doc doesn't support to do so. If there is any other query, please feel free to contact us.

Sincerely,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.Doc