我们如何使用.Net中的aspose.words在页脚中添加一个包含3行的表格

时间:2017-01-19 10:22:12

标签: aspose aspose.words

我在.net API中使用Aspose.words并遇到问题,使用此工具在单词页脚中添加单独的表格。谁能加快我的速度呢?

1 个答案:

答案 0 :(得分:1)

您可以使用以下代码在三个单元格的Word页脚中插入表格:

           var doc = new Document();

            var builder = new DocumentBuilder(doc)
            {
                PageSetup =
                {
                    Orientation = Orientation.Portrait,
                    PaperSize = PaperSize.Letter
                },

            };
        builder.MoveToHeaderFooter(Word.HeaderFooterType.FooterPrimary);
        builder.StartTable();
            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 1");


            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 2");

            builder.InsertCell();
            builder.CurrentParagraph.ParagraphFormat.Alignment = Word.ParagraphAlignment.Center;
            builder.Write("Cell 3");

        builder.EndTable();
        builder.MoveToDocumentEnd();