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.

Tue Feb 13, 2024 1:36 am

Hi Team,

Our tool uses Spire Doc library to convert a HTML page to Word document and vice versa. In this process we are observing that the font size of the bullet numbering and the spacing are getting changed during conversion. Below is what we are observing.

Consider the HTML page as below:
SpireDoc-Issue-BulletNumbering-Original HTML.png


Here is the markup for the HTML page in our tool.
Code: Select all
<div data-wrapper="true" dir="ltr" style="font-size:11pt"><div>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div><ol start="1" style="list-style-type:lower-roman"><li style="list-style-position: outside;">Et ultrices neque ornare aenean euismod elementum.</li><li style="list-style-position: outside;">Varius quam quisque id diam vel quam elementum. In arcu cursus euismod quis viverra.</li></ol><div style="list-style-position:outside">Mauris ultrices eros in cursus turpis massa tincidunt.&nbsp;</div></div>


We convert the HTML to Word using Spire Doc and everything is right at the first conversion.
SpireDoc-Issue-BulletNumbering-Original HTML.png


But if we modify any content in the word document and convert the Word to HTML, the font of the bullet numbering gets changed to 12 (even though we set it as 11).
Here is the HTML markup produced by Spire Doc while the Word to HTML conversion of the changed content:
Code: Select all
<div data-wrapper="true" style="font-size:11pt"><p style="margin-bottom:0pt; margin-left:0pt; margin-top:0pt; text-indent:0pt"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span><span>&nbsp;Modified content.</span></p><p style="margin-bottom:0pt; margin-left:36pt; text-indent:-18pt"><span style="font-size:12pt">i.</span><span style="font-size:0.58em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>Et ultrices neque ornare aenean euismod elementum.</span></p><p style="margin-left:36pt; margin-top:0pt; text-indent:-18pt"><span style="font-size:12pt">ii.</span><span style="font-size:0.58em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>Varius quam quisque id diam vel quam elementum. In arcu cursus euismod quis viverra.</span></p><p style="margin-bottom:0pt; margin-left:0pt; margin-top:0pt; text-indent:0pt"><span>Mauris ultrices eros in cursus turpis massa tincidunt.&nbsp;</span></p></div>


After that if we again convert the HTML to Word, the font size of the bullet numbering and their spacing gets changed. The font size of the spacing is wrongly set as 6.5 (even though we always set everything as 11). This results in hanging indent in the word document. Below is the screenshot of the word document.
SpireDoc-Issue-BulletNumbering-Second HTML To Word Conversion.png

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

Tue Feb 13, 2024 9:31 am

Hello,

Thank you for your inquiry.
Based on your description, I tested your code following the steps you provided and reproduced the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREDOC-10311. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 460
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.Doc

cron