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#


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);


section.PageSetup.SectionStart = SectionStart.NewPage;

section.PageSetup.LeftMargin = 10;

Body body = new Body(doc);



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.