OfdNet 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OfdNet --version 0.1.0
                    
NuGet\Install-Package OfdNet -Version 0.1.0
                    
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="OfdNet" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfdNet" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="OfdNet" />
                    
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 OfdNet --version 0.1.0
                    
#r "nuget: OfdNet, 0.1.0"
                    
#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 OfdNet@0.1.0
                    
#: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=OfdNet&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=OfdNet&version=0.1.0
                    
Install as a Cake Tool

OfdNet

ofdrw 的 .NET 10 移植,提供 OFD 文档的读取、编辑、排版生成、 数字签名、加密、OFD-A 归档转换与文档合并。

本项目是社区移植,不是 ofdrw 官方发布,不代表上游背书。

安装

推荐直接安装元包,它会带上全部模块:

dotnet add package OfdNet

也可以按需安装单个模块:

dotnet add package OfdNet.Core       # 数据模型
dotnet add package OfdNet.Pkg        # 虚拟容器 / 打包解包
dotnet add package OfdNet.Reader     # 读取、资源定位、关键字检索
dotnet add package OfdNet.Layout     # 排版生成
dotnet add package OfdNet.Sign       # 数字签名 / 签章
dotnet add package OfdNet.Crypto     # 加密 / 解密
dotnet add package OfdNet.Gm         # SM2 / SM3 / SES 国密结构
dotnet add package OfdNet.Font       # 字体度量
dotnet add package OfdNet.Archive    # OFD-A 检查与转换
dotnet add package OfdNet.Tool       # 合并、页面删除等工具

目标框架:.NET 10。

快速开始

排版生成 OFD

using Ofd.Layout;
using Ofd.Layout.Element;

using var doc = new OFDDoc("out.ofd");
doc.Add(new Paragraph("Hello OFD", 5));
doc.Add(new Div(100, 40).SetBackgroundColor(230, 240, 255));
// Dispose / Close 时完成布局并打包

读取内容

using Ofd.Reader;

using var reader = new OFDReader("out.ofd");
int pages = reader.GetNumberOfPages();
var page = reader.GetPage(1);

关键字检索

using Ofd.Reader.Keyword;

var hits = KeywordExtractor.GetKeyWordPositionList(reader, "关键词");

OFD-A 检查与转换

using Ofd.Archive.Check;
using Ofd.Archive.Convert;

var violations = new OFDArchiveChecker().Check("in.ofd");
new OFDArchiveConverter().Convert("in.ofd", "out-ofda.ofd");

字体说明

  • 随包提供 Noto Serif SC(SIL OFL 1.1),用于跨平台确定性排版;许可证随包附在 Assets/NotoSerif/OFL.txt。
  • 不提供 FangSong_GB2312.ttf。该字体版权归 GreatWall Computer Co.,没有再分发许可; 需要时请自行获取已授权副本,文件缺失时字体会回退到系统宋体。
  • 字体随文档嵌入时,请自行确认目标字体的再分发授权。

许可证与归属

  • 本项目以 Apache License 2.0 发布,全文见包内 LICENSE。
  • 上游归属、修改说明与第三方组件声明见包内 NOTICE、THIRD-PARTY-NOTICES.md。
  • 依赖:BouncyCastle.Cryptography(MIT)、SkiaSharp(MIT)。

源码与问题反馈:https://github.com/icysky/ofdrw-net

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 68 11/16/2026
0.2.1 69 11/16/2026
0.2.0 66 11/16/2026
0.1.1 92 11/2/2026
0.1.0 91 11/2/2026

Initial NuGet release (0.1.0).