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 Aug 01, 2023 5:33 pm

Hi,
We use next code (SpireDoc 11.7.0):
Code: Select all
String html = "<p><span>ONE <strong>TWO</strong> <em><strong>THREE</strong> <u>FOUR</u></em></span></p>";
        Document document = new Document();
        document.addSection().addParagraph().appendHTML(html);
        document.saveToFile("italic.pdf", FileFormat.PDF);


In result file missed space between words THREE and FOUR.

Thanks,
Andrei Chorin

andrei.chorin
 
Posts: 68
Joined: Sun Jan 08, 2023 2:36 pm

Wed Aug 02, 2023 2:07 am

Hello,

Thank you for your inquiry.
The reason for the missing space between words THREE and FOUR in your results document is that there is a nested structure in the HTML code, which results in some text not being correctly segmented. You can use the following code to implement the spacing:
Code: Select all
        String html = "<p><span>ONE <strong>TWO</strong> <em><strong>THREE</strong></em> <em><u>FOUR</u></em></span></p>";
        Document document = new Document();
        document.addSection().addParagraph().appendHTML(html);
        document.saveToFile("F:\\italic.pdf", FileFormat.PDF);


Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Wed Aug 02, 2023 6:21 am

Thanks for quick answer.
But this HTML rendered correct in browsers.
html.png

Thanks,
Andrei Chorin

andrei.chorin
 
Posts: 68
Joined: Sun Jan 08, 2023 2:36 pm

Wed Aug 02, 2023 7:31 am

Hello,

Thank you for your response.
After our investigation, we found that it is indeed a bug in our product, I have logged the issue into our bug tracking system with the ticket number SPIREDOC-9753. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.Doc