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.

Thu Nov 05, 2020 11:28 am

Hello,

we did an update from our Spire.Doc Nuget-Package (6.7.13 => 8.10.4) in .net.
In the old version there were after using method "ApplyHorizontalMerge()" no line breaks in the cell.
With the new version of Spire.Doc it sets a line break after every merge.

Example:
We have a table with 4 columns.
We merge all 4 columns to 1 column and in the Cell are 3 line breaks.
Code: Select all
table.ApplyHorizontalMerge(0, 0, 3);
=> In the generated Document are 3 line breaks in the merged cell :?

If we merge 3 columns, we get 2 line breaks in the cell.
Code: Select all
table.ApplyHorizontalMerge(3, 0, 2);
=> In the generated Document are 2 line breaks in the merged cell :?
Example.jpg

Is it possible to merge columns without the line breaks?

I hope you can help me.

Sincerely
Paul

PGullans
 
Posts: 3
Joined: Tue May 15, 2018 9:30 am

Fri Nov 06, 2020 8:15 am

Hello,

Thanks for your inquiry.
According to your description, I simulated a Word file and tested your scenario with the latest Spire.Doc v8.10.4, but did not reproduce your issue. To help us further look into your issue, could you please provide your input file and your full test code? Thanks in advance.
Moreover, you can also refer to the following code snippet to remove the line break.
Code: Select all
            for (int j = 0; j < table[0, 0].Paragraphs.Count; j++)
            {
                if ( "".Equals(table[0, 0].Paragraphs[j].Text))
                {
                    table[0, 0].Paragraphs.RemoveAt(j);
                    j--;
                }
            }


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Nov 19, 2020 9:07 am

Hello,

How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc