我们如何在 .Net 中使用 aspose.words 在页脚中添加 3 行的 table

How can we add a table with 3 rows in footer using aspose.words in .Net

我在 .net API 中使用 Aspose.words,但遇到了使用此工具在字页脚中添加单独的 table 的问题。谁能加快我的速度?

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

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