To Draw horizantal line in footer of a word document using aspose.words

To Draw horizantal line in footer of a word document using aspose.words

Hi Sreedhar,

Thanks for your inquiry. You can use the following code to achieve this:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
Shape lineShape = new Shape(doc, ShapeType.Line);
// lineShape.Width = 72 * 5; // 5 inches
lineShape.Width = doc.FirstSection.PageSetup.PageWidth -
doc.FirstSection.PageSetup.LeftMargin -
doc.FirstSection.PageSetup.RightMargin;
builder.InsertNode(lineShape);
doc.Save(MyDir + @"out.docx");

I hope, this helps.

Best regards,