Free Support Forum - aspose.com

Extra line at the end of block

We are generating a word document using Aspose.Word acccording to the template 'Test_Template.doc'.
At the end of each block , we need a line to be printed. We have set the bottom border for table for the same.
Refering to Sample_Doc.doc , page no 1, we are getting two lines at the end of block.(Area highlighted in red color.)
How can we remove the extra line.

Please suggest us some solution as soon as possible. This is very urgent.

Let me know if problem description is not clear.

Thanks & Regards

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Could you please provide me sample code, which will allow me to reproduce the problem? I will check it on my side and provide you more information.

Best regards,

Hi,

Thanks for your reply.
We are not rendering line anywhere in the code.
We have set the border of table in template itself.
We are using 'cloning' to merge cells and form the table as shown below:

newRow = (Aspose.Words.Tables.Row)WordRow.Clone(true);
doc.FirstSection.Body.Tables[0].AppendChild(newRow);

Please help us to find why we are getting two lines in the file.

Any help will be appreciated.

Thanks & Regards

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I cannot reproduce the problem on my side using the latest version of Aspose.Words. I use the following code for testing:

//Open the document.

Document doc = new Document("Test_Template.doc");

NodeCollection tabColl = doc.GetChildNodes(NodeType.Table, true);

for (int i = 0; i < 5; i++)

{

Row newRow = (Row)((Table)tabColl[2]).Rows[0].Clone(true);

doc.FirstSection.Body.Tables[0].AppendChild(newRow);

}

doc.Save("out.doc");

I sent the output document produced on my side to your e-mail.

Bets regards,