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 Jun 21, 2023 12:01 pm

Hi,
We have this code (Spire.Doc for Java 11.6.0):
Code: Select all
        Document document = new Document();
        document.addSection().addParagraph().appendHTML("<html><p>&nbsp;</p>\n" +
                "<p dir=\"ltr\">&nbsp;</p>\n" +
                "<p dir=\"ltr\">게으른 개를 뛰어넘는 재빠른 갈색 여우</p>\n" +
                "<p dir=\"ltr\">&nbsp;</p>\n" +
                "<p dir=\"rtl\">تیز بھوری لومڑی سست کتے پر چھلانگ لگاتی ہے۔</p></html>");
        document.saveToFile("preview.docx", FileFormat.Docx_2019);

But in docx file no RTL string and don't see Korean (looks like color font is white)
preview.png


Thanks,
Andrei Chorin

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

Thu Jun 22, 2023 6:43 am

Hi Andrei,

I tested your code and found that the Korean text in my result document and your attached document can be displayed normally (I am using Word 2021), as shown in the picture below. But when I save the document to PDF using the code, the Korean text was not displayed.
compare.jpg

I have attached my test document for your reference. Please download and open it to see if the Korean text is displayed or not.
As for the RTL string you mentioned, I don't quite understand it. Can you please provide the effect you expect or explain it?

Best regards,
Triste
E-iceblue support team
User avatar

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

Thu Jun 22, 2023 9:40 am

Hi Triste, thanks for quick answer,
Regarding RTL problem, LTR text expected to be aligned to right and LTR selector enabled.
Please see attached image.
expected.png

Thanks,
Andrei

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

Fri Jun 23, 2023 3:49 am

Hello,

Thanks for your feedback.
Yes, I indeed found the <p dir="ltl"> tag didn't take effect when appending the html string to the word document. I have logged the issue into our bug tracking system with the ticket SPIREDOC-9560. Our Dev team will do more investigations to fix it. Once there is any update, we will keep you informed asap.
Besides, about Korean text, when converting to PDF, it needs to embed the corresponding font that can display Korean, like the following code to embed the "Batang" font. I also attached the font file for your reference.
Code: Select all
        Document document = new Document();
        document.addSection().addParagraph().appendHTML("<html><p>&nbsp;</p>\n" +
                "<p dir=\"ltr\">&nbsp;</p>\n" +
                "<p dir=\"ltr\">게으른 개를 뛰어넘는 재빠른 갈색 여우</p>\n" +
                "<p dir=\"ltr\">&nbsp;</p>\n" +
                "<p dir=\"rtl\">تیز بھوری لومڑی سست کتے پر چھلانگ لگاتی ہے۔</p></html>")
        ToPdfParameterList toPdf = new ToPdfParameterList();
        List<PrivateFontPath> fonts = new List<PrivateFontPath>();
        fonts.add(new PrivateFontPath("Batang", "E:\\Batang.ttf"));
        toPdf.setPrivateFontPaths(fonts);
        toPdf.isEmbeddedAllFonts( true);
        document.saveToFile("test_out.pdf", toPdf);

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Tue Jul 11, 2023 6:26 am

Hi,
Do we have an update for RTL issue.
Thanks a lot,
Andrei

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

Tue Jul 11, 2023 6:52 am

Hi Andrei,

Thank you for inquiring about the progress of the issue fix. We would like to provide you with an update on the matter.

Our dev team submitted the fix for testing on July 5th; however, during the testing phase, it was discovered that this fix had unintended consequences on the processing of other documents. As a result, the test did not pass. Our development team has since made necessary modifications to the code.

We are pleased to inform you that the revised code has been submitted, and we are currently awaiting the outcomes of the testing process.

We appreciate your understanding and patience while we work towards rectifying the problem. If you have any further questions or concerns, please feel free to reach out to us.

Thank you for your cooperation.

Best regards,
Triste
E-iceblue support team
User avatar

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

Tue Aug 15, 2023 2:25 pm

Hi,
Do we have any estimation for this issue?

Thanks,
Andrei Chorin

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

Wed Aug 16, 2023 1:48 am

Hi Andrei ,

Thanks for your following-up.
I checked the status of this issue, it has not been solved yet, I have given this issue the highest priority and asked our dev team to solve it asap. Apologize for any inconvenience caused. Once the issue is fixed, I will inform you asap. Thanks for your understanding and patience.

Best regards,
Triste
E-iceblue support team
User avatar

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

Fri Sep 15, 2023 2:15 am

Hi Andrei,

Thanks for your patience.
Glad to inform you that we just released Spire.Doc for Java 11.9.5, which has fixed your issue SPIREDOC-9560. Please download from the following links and have a test.
Website: https://www.e-iceblue.com/Download/doc-for-java.html
Maven:
Code: Select all
<repositories>
    <repository>
        <id>com.e-iceblue</id>
        <name>e-iceblue</name>
        <url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.doc</artifactId>
        <version>11.9.5</version>
    </dependency>
</dependencies>


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