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.

Mon May 11, 2020 7:39 pm

Hello,

I downloaded the trial version and before I purchase a license I am wondering if this is a bug? I can't seem to figure out what is going on.

I have a word document and I used Spire.Doc to split the Word document by page break using the tutorial on this site. I tried linking to the tutorial but this won't let me.


Everything seemed to work fine. I then tried to convert each docx into an html file. So I did a simple modification of the tutorial on this site to perform this with a foreach file in a folder.
I tried linking to the tutorial but this won't let me.

However, some of the files that were split using the step above are throwing an exception in the convert code below. I get the following exception:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index'
I am not using a parameter name of index? Which makes me think it is a bug.


And the resulting .html is only a partial of the .docx input file. Can anyone else duplicate this error? Any help would be appreciated.

I have attached the input file and the output file for the save to html in a zip.

Code: Select all
            string[] strFiles = Directory.GetFiles(@"E:\junk\result");
            int iFileIndexer = 0;
            foreach (string strFile in strFiles)
            {
                Spire.Doc.Document objDocument = new Spire.Doc.Document();
                objDocument.LoadFromFile(strFile);

                try
                {
                    string strOutFileName = @"E:\junk\html\html" + iFileIndexer.ToString() + ".html";
                    objDocument.SaveToFile(strOutFileName, FileFormat.Html); //[b]<<<---------- Exception here[/ b]
                    objDocument.Close();
                }
                catch (Exception objException)
                {
                    objDocument.Close();
                }
                iFileIndexer++;
            }

joeschmack
 
Posts: 1
Joined: Thu May 07, 2020 8:32 pm

Tue May 12, 2020 2:26 am

Hello,

Thanks for your inquiry.
I have reproduced your issue and logged it into our bug tracking system with the ticket SPIREDOC-4417. If there is any progress, we will inform you.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Jun 05, 2020 11:01 am

Hello,

Thanks for your patient waiting.
Glad to tell you that we just released Spire.Doc Pack(hot fix) Version:8.6.3 which fixes your issue. Welcome to download it from the following links.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/8.6.3

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Jun 12, 2020 5:44 am

Hello,

Hope you are doing well.
Have you tested the hotfix? Could you please give us some feedback at your convenience?
Looking forward to your response.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc