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.

Sun Jan 12, 2020 1:30 pm

Hi!
We recently purchased your amazing package, nice work Guys!
But we ran into some problems...
We produce documents with dynamic text in the following languages ​​- Hebrew and English. Sometimes in 2 languages ​​together. And of course we also have numbers, sometimes it can be in the form of formulas. The final product we save as WORD and XPS. so...
1. If we apply CharacterFormat.Bidi = true on TextRange, as we sought in documentation, we get reverse numbers in formulas, the letters in Hebrew are RTL but the numbers are LTR and this parameter reverses also a numbers.
2. Designing the Lists - In some documents we need to sort lists by letters in Hebrew, but in XPS (and PDF) files are sorted by numbers ...
3. Also we have some cosmetic changes between DocX, XPS (also pdf) but it's a small issue
Thanks in advance. Attaching code for testing.

Code: Select all
  private static void RtlXPSTest()
        {
            var pathXPS = @"C:\RTL.xps";
            var pathDOC = @"C:\RTL.DOCX";
            var pathPDF = @"C:\RTL.PDF";

            var text = new List<string> {
               "בדיקת מספרים 12345",
               "בדיקת אנגלית ABCDE",
               "נוסחאות 1 + 1 = 4",
                "SOME TEXT ואחרי זה משהו בעברית!"};

            using (var document = new Document())
            {
                document.AddSection();
                document.Sections[0].PageSetup.Bidi = false;

                ListStyle listStyle = new ListStyle(document, ListType.Numbered);
                document.ListStyles.Add(listStyle);
                listStyle.Name = "hebrewListStyle";
                listStyle.Levels[0].PatternType = ListPatternType.Hebrew2;

                foreach (var t in text)
                {
                    var p = document.Sections[0].AddParagraph();
                    p.Format.IsBidi = true;

                    var r = p.AppendText(t);
                    r.CharacterFormat.FontName = "Arial";
                    r.CharacterFormat.FontNameBidi = "Arial";
                    r.CharacterFormat.FontSize = 16;
                    r.CharacterFormat.FontSizeBidi = 16;
                    //r.CharacterFormat.Bidi = true;

                    p.ListFormat.ApplyStyle("hebrewListStyle");

                    p.AppendBreak(BreakType.LineBreak);
                }
                document.SaveToFile(pathDOC, FileFormat.Docx2013);
                document.SaveToFile(pathXPS, FileFormat.XPS);
                document.SaveToFile(pathPDF, FileFormat.PDF);
            }

            Process.Start(pathDOC);
            Process.Start(pathXPS);
            Process.Start(pathPDF);
        }

SapiensIsrael
 
Posts: 7
Joined: Tue Jan 07, 2020 7:24 am

Mon Jan 13, 2020 7:16 am

Hi,

Thanks for your inquiry.
After testing your case with CharacterFormat.Bidi = true on TextRange, I noticed following issues:
1. The numbers and formulas also are LTR
2. The list in XPS and PDF are incorrect
I have logged this two issues in our bug tracking system, we will let you know once there is any update. Sorry for the inconvenience caused.

As for the issue#3, sorry that I didn't find it. Could you please point out where has the issue? And please provide the output file you got and the expected file you want.

Besides, we don't find the purchase information related to your register email. Could you please provide your Order number or purchase email so that we could record your purchase information?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Jan 13, 2020 7:42 am

Hi!
Thank You for your response!
I didn’t understand your position about issue #1 (in case of CharacterFormat.Bidi =true) – do you see numbers in RTL or LTR? I see them in RTL…
As for issues 3#. As you can see on attached image - in XPS and PDF in 4rd item in list – text starts from English text followed by Hebrew, as It shown in Doc, but in XPS and PDF it, unfortunately, reversed.
Thank you!

SapiensIsrael
 
Posts: 7
Joined: Tue Jan 07, 2020 7:24 am

Mon Jan 13, 2020 8:20 am

Hi,

Thanks for your fast response and sorry for the misunderstand.
As for the issue#1, I see the direction is RTL. Sorry that I am a little confused according to your information, what is your excepted result?
As for the issue#3, I logged this issue in our bug tracking system. We will let you know once there is any update.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc