Angri450.Nong.Docx 3.1.1

dotnet add package Angri450.Nong.Docx --version 3.1.1
                    
NuGet\Install-Package Angri450.Nong.Docx -Version 3.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Angri450.Nong.Docx" Version="3.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Angri450.Nong.Docx" Version="3.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Angri450.Nong.Docx" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Angri450.Nong.Docx --version 3.1.1
                    
#r "nuget: Angri450.Nong.Docx, 3.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Angri450.Nong.Docx@3.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Angri450.Nong.Docx&version=3.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Angri450.Nong.Docx&version=3.1.1
                    
Install as a Cake Tool

Angri450.Nong.Docx

纯 .NET Word 文档引擎。angri450 从零构建 —— 链式写入、JSON 模板驱动样式、模板填充、图片嵌入、论文诊断、OCR 转 Word,一套包搞定。零 COM、零 ImageSharp、跨平台。

NuGet .NET

Supported Platforms

.NET 8.0 and above (net8.0, net9.0, net10.0, net11.0). Windows, macOS, Linux.

Install

dotnet add package Angri450.Nong.Docx

Quick Start

using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using DocxCore;

using var doc = WordprocessingDocument.Create("paper.docx",
    WordprocessingDocumentType.Document);
var main = doc.AddMainDocumentPart();
main.Document = new Document(new Body());
var body = main.Document.Body!;

// JSON 模板定义样式
var sp = main.AddNewPart<StyleDefinitionsPart>();
sp.Styles = new Styles();
StyleBuilder.BuildFromJson(sp.Styles, "formats/journal-paper.json");

// 链式写入内容
var w = new DocumentWriter(body);
w.Title("Research on Photosynthesis")
 .Abstract("This study investigates...")
 .Keywords("photosynthesis; chlorophyll; light")
 .Heading("Introduction", 1)
 .Body("Photosynthesis is the process by which plants...")
 .Heading("Methods", 1)
 .Body("Samples were collected from...")
 .Table("Growth Data", 1, new[] { "Day", "Height (cm)", "Leaf Count" },
     new[] { new[] { "1", "2.3", "4" }, new[] { "7", "5.1", "8" } })
 .TableStyle(TableStyles.LightGridAccent1)
 .BibHeading()
 .References("Smith J. Photosynthesis review[J]. Nature, 2025.");

// 图片嵌入
ImageEmbedder.EmbedImages(body, main, new[] { "fig1.png", "fig2.png" });

body.Append(StyleBuilder.LoadPageLayout("formats/journal-paper.json").Build());
main.Document.Save();

Core Capabilities

DocumentWriter — 链式构建器

angri450 设计的链式 API,覆盖论文写作全流程:

Method Description
Title() / EnglishTitle() 中英文标题
Abstract() / Keywords() 摘要和关键词块
Heading(text, level) 章节标题(1-4 级)
Body(text) 正文段落
Footnote(text) / Endnote(text) 脚注和尾注
Table(caption, level, headers, rows) 数据表格(带标题)
TableStyle(style) 90+ 内置表格样式
Figure(caption, level) 图位(带标题)
CrossReference(bookmark, text) 内部交叉引用
Hyperlink(url, text) 外部超链接
BibHeading() / References(text) 参考文献部分
Bookmark(name) 命名书签供交叉引用

格式模板 — JSON 驱动样式

angri450 设计:换一个 JSON 文件 = 换一套格式。竞赛论文 → 期刊 → 毕业论文,秒切换。

StyleBuilder.BuildFromJson(sp.Styles, "formats/journal-paper.json");
var sectPr = StyleBuilder.LoadPageLayout("formats/journal-paper.json").Build();
Template 正文字体 标题字体 用途
life-sciences-contest 宋体 10.5pt 黑体 14pt 竞赛论文(4 页)
journal-paper 宋体 10.5pt 黑体 18pt 期刊论文(GB/T 7714)
course-paper 宋体 10.5pt 黑体 14pt 课程论文
degree-thesis 宋体 12pt 黑体 16pt 学位论文

模板引擎 — 占位符填充

DocxTemplate.Fill("template.docx", "output.docx", new
{
    Name = "Zhang",
    Score = 95,
    Date = "2026-06-01"
});
// 支持: {{tag}} 替换、@if/@foreach 块、表格行数据绑定

图片嵌入

ImageEmbedder.EmbedImages(body, mainPart, new[] { "fig1.png", "fig2.png" });
// PNG/JPEG/GIF/BMP/TIFF — 无需外部图片库

SectionBuilder — 页面布局

var sectPr = new SectionBuilder()
    .A4()
    .Margins("3cm", "2.5cm", "2.5cm", "2cm")
    .Build();

论文分析(16 种类型 + A-E 评级)

angri450 实现的论文诊断管线:

var type = PaperTypeClassifier.Classify(text);              // 研究设计类型
var structure = PaperStructureExtractor.BuildPaperStructure(text); // 章节提取
var variables = VariablePlanGenerator.GenerateVariablePlan(text);  // 变量表
var risks = ReferenceAnalyzer.CheckReferenceRisks(text);    // 参考文献质量
var result = PaperDiagnostics.DiagnosePaperQuality(text, ...);     // A-E 评级
// 证据链(10 项)→ 数据需求(9 项)→ 缺口 → 等级

高级特性

批注、修订模式、内容控件、字体嵌入、文档合并、文档属性管理、只读保护。

WordPreview — 生成 + 诊断

var r = WordPreview.Preview("paper.docx");
// 文本预览 + 7 步诊断 + OOXML 验证

Dependencies

  • Angri450.Nong.ThirdParty — 合并基础库(DocumentFormat.OpenXml + 全部传递依赖)

System.Drawing.Common、无 ImageSharp、无 COM。跨平台。

API Reference

Class Description
DocumentWriter 链式内容构建器
StyleBuilder JSON 驱动样式和页面布局定义
DocxTemplate 模板引擎(占位符/标签替换)
ImageEmbedder 图片插入(自动检测尺寸)
SectionBuilder 页面布局(A4、边距、分栏)
PaperDiagnostics 论文质量诊断(A-E 评级)
WordPreview 内容预览和验证
AdvancedFeatures 批注、修订、内容控件、保护

Author

Built by angri450. Source: Nong.NET.

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Angri450.Nong.Docx:

Package Downloads
Angri450.Nong.MultiModal

多模态文档处理库 — OCR、语音转文字、文字转语音。首个能力:PaddleOCR-VL-1.6 云端 API + 本地 PaddleOCR CPU 混合识别。

Angri450.Nong.Inspect

AI-generated content inspection toolkit. Reviews academic papers, official documents, letters, charts, and diagrams for formatting, structure, and content quality issues. Built on Angri450.Nong.Docx.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.1 0 6/5/2026
3.1.0 81 6/2/2026
3.0.2 148 6/1/2026
3.0.1 95 6/1/2026
3.0.0 104 6/1/2026
2.0.0 90 5/30/2026
1.0.7 84 5/30/2026
1.0.6.1 87 5/30/2026
1.0.6 94 5/30/2026
1.0.5 82 5/25/2026
1.0.4 81 5/25/2026
1.0.3 84 5/25/2026
1.0.2 87 5/25/2026
1.0.1 95 5/24/2026
1.0.0 86 5/24/2026