.Net Core 如何實作匯出的word 分欄 需要代碼Npoi試過好像不行
uj5u.com熱心網友回復:
free spire.doc.dll吧,包里面有.netcore的dll,應該是可以實作分欄,代碼供參考:
using Spire.Doc;
namespace Word分欄
{
class Program
{
static void Main(string[] args)
{
//初始化Document實體
Document doc = new Document();
//加載現有檔案
doc.LoadFromFile("test.docx");
//獲取第二個section
Section section = doc.Sections[1];
//添加兩欄,并設定每一欄的寬度及二者的間距
section.AddColumn(300,30);
//section.AddColumn(150f, 10f);
//顯示分割線
section.PageSetup.ColumnsLineBetween = true;
//保存并打開檔案
doc.SaveToFile("添加分欄.docx", FileFormat.Docx2013);
System.Diagnostics.Process.Start("添加分欄.docx");
}
}
}
分欄效果:
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/267619.html
標籤:.NET技術前瞻
