【问题标题】:How can we add a table with 3 rows in footer using aspose.words in .Net我们如何在 .Net 中使用 aspose.words 在页脚中添加 3 行的表格
【发布时间】:2017-01-19 10:22:12
【问题描述】:

我在 .net API 中使用 Aspose.words 并遇到问题,使用此工具在 word 页脚中添加单独的表格。任何人都可以加快我这样做吗?

【问题讨论】:

标签: aspose aspose.words


【解决方案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();

【讨论】:

  • 太棒了。这样做非常有帮助,而且非常容易。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-05-20
  • 1970-01-01
  • 1970-01-01
  • 2019-12-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多