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 09, 2022 10:40 am

For some paragraphs in attached document value of member CharCountIncludeSpace far less than CharCount value.
It is very strange since text with spaces must be equal or more then the same text without spaces.

Code: Select all
            string file = GetFile(fileName, System.Reflection.MethodBase.GetCurrentMethod());

            LicenceManager.SetSpireDoc();
            LicenceManager.SetSpirePdf();

            List<Paragraph> wrongParagraps = new List<Paragraph>();
            Document document = new Document(file) { UseNewEngine = true };

            foreach (Section section in document.Sections)
            {
                foreach (Paragraph paragraph in section.Paragraphs)
                {
                    if (paragraph.CharCount <= paragraph.CharCountIncludeSpace)
                    {
                       
                    }
                    else
                    {
                        wrongParagraps.Add(paragraph);
                    }
                }
            }

            foreach (var item in wrongParagraps)
            {
                Console.WriteLine(item.Text);
            }

            document.Close();
            document.Dispose();

Kazax_Kazax
 
Posts: 13
Joined: Tue Nov 30, 2021 4:58 pm

Mon Jan 10, 2022 3:22 am

Hello,

Thanks for your inquiry.
I tested your sample Word File and did reproduce your issue. I have logged the issue into our bug tracking system with the ticket number SPIREDOC-7218. 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

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Mon Aug 01, 2022 9:24 am

Hello,

Thanks for your patience!
Glad to inform you that we just released Spire.Doc Pack(hot fix) Version:10.7.16 which fixes the issue of SPIREDOC-7218.
Please download the new version from the following links to test.

Website link: https://www.e-iceblue.com/Download/download-word-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/10.7.16

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc