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



我正在.net API中使用Aspose.words,并使用此工具在word页脚中添加一个单独的表。谁能加快我的速度?

您可以使用

以下代码在带有三个单元格的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();

最新更新