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> </p>\n" +
"<p dir=\"ltr\"> </p>\n" +
"<p dir=\"ltr\">게으른 개를 뛰어넘는 재빠른 갈색 여우</p>\n" +
"<p dir=\"ltr\"> </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
Login to view the files attached to this post.