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 Feb 14, 2024 7:20 pm

Hello Team,

I am currently facing an issue regarding HTML to Word conversion using Spire Doc:

Below is the HTML code:
<span>By:&nbsp; </span>
<u style="text-decoration:underline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u>

When we convert this to word the underline doesn't appear. Please refer the attached screenshots.

original_html.png


converted doc with SpireDoc.png


Please note that I am using the latest hotfix version of Spire doc and I use Windows 11 64-bit operating system and my region setting is United States and English.

Also, would like to mention that on first HTML to Word conversion the underlines are populated correctly. Then we do Word to HTML conversion which also results in the exact same HTML markup. The issue happens on the next HTML to Word conversion onwards.

Please note that, I had created another support ticket regarding the same. But I am unable to post any reply on that. 'https://www.e-iceblue.com/forum/post54815.html#p54815'. That's why I created this new ticket.

somanwita21
 
Posts: 8
Joined: Mon Feb 27, 2023 9:04 pm

Thu Feb 15, 2024 2:57 am

Hello,

Thanks for your feedback.
Sorry, we still haven't reproduced the issue you mentioned? What programming language and project type are you using? Can you also provide us with a simple project that can run directly and reproduce your problem? Thank you for your assistance.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Mon Mar 04, 2024 8:45 pm

I am reaching out to you regarding a Spire Doc issue I raised few days back. Spire doc - HTML to Word conversion issue - with underlines : Spire.Doc (e-iceblue.com) . Though the Spire Doc team claimed that its resolved, but we are still facing the issue. Please find the repro step as below:
1. Please find the original html named "original.html" in the zip file attached.
2. Convert the HTML to Word using SPIRE Doc. The underlines appear in this document and everything looks correct. Please find the word document named "Spire Underline issue test2 - first html to word conversion.docx" in the zip file attached.
3. Modify the content of the word document. Please find the word document named "Spire Underline issue test2 - first html to word conversion_after modifying.docx" in the zip file attached.
4. Convert the Word document to HTML using SPIRE Doc. The underline still appears in the HTML. Please find converted html named "html markup after first word to html conversion.html" in the zip file attached.
5. Then we again convert the HTML to Word using SPIRE Doc. We notice that the underline doesn't appear anymore. Please find the word document named "Spire Underline issue test2 - second html to word conversion.docx" in the zip file attached.

Please note that I am using the Spire doc 12.1.5 version and work in C# Programming language. I use Windows 11 64-bit operating system. My region setting is United States and English.

somanwita21
 
Posts: 8
Joined: Mon Feb 27, 2023 9:04 pm

Tue Mar 05, 2024 11:14 am

Hello,

Thanks for the guidance.
Yes, I have reproduced the issue you mentioned with the code below. I have logged it into our bug system with the ticket SPIREDOC-10356. Once it is resolved or there is any update, I will notify you without any delay. Sorry for the inconvenience caused to you.
Code: Select all
// Word to html
Document document = new Document();
document.LoadFromFile(@"Spire Underline issue test2 - first html to word conversion_after modifying.docx");
document.HtmlExportOptions.CssStyleSheetType = CssStyleSheetType.Internal;
document.HtmlExportOptions.IsTextInputFormFieldAsText = true;
document.HtmlExportOptions.ImageEmbedded = true;
document.SaveToFile(@"res.html", Spire.Doc.FileFormat.Html);
// Html to word
Document document2 = new Document();
document2.LoadFromFile("res.html", FileFormat.Html);
document2.SaveToFile("res.docx", FileFormat.Docx2016);


Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc