我在.net API中使用Aspose.words并遇到问题,使用此工具在单词页脚中添加单独的表格。谁能加快我的速度呢?
答案 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();