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 Sep 08, 2023 5:40 pm

I used this type of code to generate Word and PDF:

'Specify HTML string
Dim xhtmlString As String = "<html><head><style type=""text/css"">li,p{font-family:'Lucida Sans Unicode';font-size:14pt;}</style></head><body><font size=""16pt"" color=""blue""><h2 align=""center"">Document Template</h2></font><p><b>Headings:</b></p><ul type=""disc""><li><span style='color:green;'>Main Heading</span></li><li>Sub Headings</li><li><span style='color:red'>Sub Sub Headings</span></li></ul></ul><table border=""1"" width=""90%""><tr><th>Steps to set Alt text for images</th></tr><tr><td>Right-click on the image.</td></tr><tr><td>Select Format Picture.</td></tr><tr><td>The Format Picture dialog box will appear. Select the Web tab</td></tr><tr><td>In the Alternative text box, type in the description of the image, then click OK.</td></tr></table></body></html>"

xhtmlString = html
'Initialize an instance of the Document class
Dim xdocument As Spire.Doc.Document = New Spire.Doc.Document
'Add a section
Dim xsection As Spire.Doc.Section = xdocument.AddSection()
'Add a paragraph
Dim xparagraph As Spire.Doc.Documents.Paragraph = xsection.AddParagraph()
'Append the HTML String to the paragraph
xparagraph.AppendHTML(xhtmlString)
'Save the result document
xdocument.SaveToFile("C:\Users\boma0504\Downloads\CMDP\HtmlStringToWord.docx", Spire.Doc.FileFormat.Docx2013)
xdocument.Dispose()

Until version 10.7.0 everything was going well.

But with version 10.7.16 or higher, the lines around the table become big dots!

AdminDev
 
Posts: 1
Joined: Mon May 13, 2019 7:19 pm

Mon Sep 11, 2023 3:53 am

Hi,

Thanks for your feedback.
I have created a simple Console App to test your document, using the latest Spire.Doc_11.8.18, but I did not reproduce your issue. I have attached my result document for your reference.
result.png

To help us reproduce your issue, please share us with the following messages, you can send them to us via email ([email protected]) or attach them here.
1. your application type, such as Console App .NET 4.8.
2. your test environment, such as OS info (Windows 10 64bit) and region setting (China, Chinese).

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc

cron