We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Page left margin is incorrect after cloning the section using C#

HI

I have the following code to create clone table

Aspose.Words.Tables.Table tableClone = (Aspose.Words.Tables.Table)table.Clone(true);

Section section = new Section(doc);

doc.AppendChild(section);

section.PageSetup.SectionStart = SectionStart.NewPage;

section.PageSetup.LeftMargin = 10;

Body body = new Body(doc);

section.AppendChild(body);

body.AppendChild(tableClone);

Using this code i can able to create clone table,my problem is clone table is not in the same left align as the original table,the clone table is moving little forward from left.How to make both same leftmargin

Hi Ajeesh,

Thanks for your query. Please use the following line of code for your requirement. Hope this helps you. Let me know, If you have any more queries.

//section.PageSetup.LeftMargin= 10;
section.PageSetup.LeftMargin = doc.FirstSection.PageSetup.LeftMargin;

Hi there,


Thanks for your inquiry.

You may also find it easier to clone the parent section of the table and clear it of all nodes instead of creating a new section from scratch. This way all section formatting will remain the same.

Thanks,