npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fuxinsoft/fuxin-pdf-ofd-sdk-node

v12.0.0

Published

Fuxin PDF OFD SDK For Node.js.

Readme

福昕 PDF OFD SDK v12.0

发布日期:2026 年 9 月 30 日

本版本包含 PDF(桌面/服务器)相对 v11.1 的能力变更,以及 FLD / OFD 相对 v12.0 预览版的变更。

PDF(桌面/服务器)

不兼容变更

从 v11.1 升级时,以下变更可能需要修改代码;未调整的项目可能无法编译或出现行为变化。

Node.js npm 包名变更

中文区 npm 包名已调整。升级到 12.0 后,安装命令与代码中的 require / import 需同步修改:

| 旧包名 | 新包名 | | --- | --- | | @foxitsoftware/foxit-pdf-sdk-node 或 @fuxin/foxit-pdf-sdk-node | @fuxinsoft/fuxin-pdf-sdk-node |

# v12.0
npm i @fuxinsoft/fuxin-pdf-sdk-node
# 或
yarn add @fuxinsoft/fuxin-pdf-sdk-node

所需操作: 全局检索并替换旧包名;重新安装依赖后验证 Node.js 示例与现有工程可正常加载原生模块。

SearchCallback::NeedToCancel — 新增纯虚方法

全文检索回调新增纯虚方法,未实现将导致编译失败:

// 旧版本:无此方法
// 12.0 起
virtual bool NeedToCancel() = 0;

所需操作: 所有 SearchCallback 子类必须实现该方法;若不需要取消,直接返回 false。

WatermarkSettings 构造函数与 Set — 参数扩展

构造函数与 Set 在末尾新增两个参数:bool is_offset_centered、float relative_scale_to_page。

// 旧版本
WatermarkSettings(position, offset_x, offset_y, flags, scale_x, scale_y, rotation, opacity);
settings.Set(position, offset_x, offset_y, flags, scale_x, scale_y, rotation, opacity);

// 12.0 起
WatermarkSettings(position, offset_x, offset_y, flags, scale_x, scale_y, rotation, opacity,
                  is_offset_centered, relative_scale_to_page);
settings.Set(position, offset_x, offset_y, flags, scale_x, scale_y, rotation, opacity,
             is_offset_centered, relative_scale_to_page);

所需操作: 按新签名补充参数。不需要相对缩放时可传 relative_scale_to_page = 0;不需要居中偏移时可传 is_offset_centered = false。

FillerAssistCallback::Refresh — 签名变更

表单填充辅助回调的刷新接口签名变更:

// 旧版本
virtual void Refresh(const PDFPage& page, const RectF* rect) = 0;

// 12.0 起
virtual void Refresh(const PDFPage& page, const RectF& rect, bool has_reparse_page) = 0;

所需操作: 更新所有 FillerAssistCallback 实现:rect 改为引用;按需处理 has_reparse_page。

Preflight::Analyze / AnalyzeAndFixup — 返回类型变更

合规模块中上述接口由无返回值改为返回 ResultInformation。参数未变,仅返回类型变化:

| 接口 | 旧返回类型 | 新返回类型 | | --- | --- | --- | | Analyze | void | ResultInformation | | AnalyzeAndFixup | void | ResultInformation |

所需操作: 调用方按新返回类型接收并处理结果。

仅在使用对应新能力时才需要实现的回调(未使用则无需改动):

  • PreflightGroupLocalCallback:经 Preflight::SetPreflightGroupLocalCallback 本地化分组项名称/注释。需实现 Release、GetGroupItemLocalName、GetGroupItemLocalComment。

TaggedPDF / 无障碍 API — 头文件迁移与 StartTagDocument

PDF 无障碍相关 API 迁入 accessibility 附加模块;自动标记入口也有调整:

| 项目 | 旧版本 | 12.0 起 | | --- | --- | --- | | 头文件路径 | pdf/pdfaccessibility/… | addon/accessibility/…(包内亦可能提供 fs_taggedpdf.h 等,以发布包为准) | | 构造函数 | TaggedPDF(const PDFDoc& doc) | TaggedPDF(const PDFDoc& doc, bool is_fix = false) | | 打标签入口 | StartTagDocument(pause = NULL);另有 SetCallback | StartTagDocument(pause, report_callback = NULL, callback = NULL);SetCallback 已弃用 | | pause 默认值 | 有默认 NULL | 无默认值,须显式传入(可为 NULL) |

// 旧版本
TaggedPDF tagged(doc);
tagged.SetCallback(cb);
tagged.StartTagDocument();

// 12.0 起
TaggedPDF tagged(doc, false);
tagged.StartTagDocument(NULL, report_stream, provider_callback);  // pause 须显式传入

所需操作: 更新 #include;去掉 SetCallback,改在 StartTagDocument 传入报告流与可选的 AutoTagProviderCallback;始终显式传入 pause。

DWG2PDFSettingData::export_hatches_type — 默认值变更

未显式设置时,填充(hatch)导出默认类型发生变化(静默行为变化):

| 属性 | 旧默认值 | 新默认值 | | --- | --- | --- | | export_hatches_type | e_DWG2PDFExportHatchesTypeBitmap | e_DWG2PDFExportHatchesTypePolygons | | other_export_hatches_type | —(无此属性) | e_DWG2PDFExportHatchesTypeBitmap | | gradient_export_hatches_type | —(无此属性) | e_DWG2PDFExportHatchesTypeBitmap |

所需操作: 若需保持旧版本行为,显式设置 export_hatches_type = e_DWG2PDFExportHatchesTypeBitmap;可按需配置新增的其他/渐变填充属性。

JavascriptEventType — 部分枚举数值偏移

旧版本中,FieldKeyStroke(值为 19)与 FieldValidate 之间预留了未使用的整型空位(20)。12.0 将该空位分配给 FieldValidate,其后枚举依次前移 1:

| 枚举 | 旧值 | 新值 | | --- | --- | --- | | FieldKeyStroke | 19 | 19(未变) | | FieldValidate | 21 | 20 | | FieldCalculate | 22 | 21 | | FieldFormat | 23 | 22 | | …直至 MediaStop | 46 | 45 |

所需操作: 始终使用枚举符号(如 e_JavascriptEventTypeFieldValidate),不要硬编码整型枚举值。若业务写成 if (type == 21) 并期望 FieldValidate,在 12.0 及更高版本中整型 21 实际对应 FieldCalculate。


新增功能与增强

平台

  • Node.js(Node-API):将 Node.js 原生绑定从传统 Node/V8 Binding 迁移到 Node-API,并提供 napi3 / napi6 / napi8 预编译包,扩大兼容范围(约 Node.js 8.15–26;个别历史小版本除外);安装时自动匹配当前运行环境。
  • Simple Demo 命令行示例:Simple Demo 支持命令行参数,示例发布于 https://github.com/foxitsoftware/foxit-pdf-sdk-cli-samples。

转换

  • Markdown 与 PDF 互转:新增 Markdown 转 PDF(Md2PDF::ConvertFromMarkdown)与 PDF 转 Markdown(PDF2Md::ConvertToMarkdown);使用前需加载 Conversion 库并具备对应模块授权。
  • 增强 DWG/DXF 转 PDF:可通过 DWG2PDFSettingData 配置布局范围、图框 XML、自动切割、线宽样式与输出 DPI 等。默认 hatch 类型变更见上文 export_hatches_type。
  • Java 跨平台统一 Office 转 PDF 入口:fromWord / fromExcel / fromPowerPoint 使用同一套方法参数,由 SDK Java 绑定按平台内部分派;原有分平台 API 仍保留。

OCR

  • 增强 OCR 识别质量(大图处理、特定中文乱码等场景)。请同步升级本版本配套的 ABBYY OCR 资源包。

安全与签名

  • ISO 32004 文档完整性保护:独立模式(PDFDoc::StartIntegrityProtection)与签名附着模式(StartIntegrityProtectionWithSignature),可配置摘要算法、口令、权限位与是否加密元数据。

文本与内容

  • 按 Unicode 查询字形 ID:Font::GetGlyphID。
  • 全文检索忽略模式串空白:FullTextSearch::SetIgnoreSpace,默认关闭,无需重建索引。
  • 全文检索支持协作取消(见上文 NeedToCancel)。
  • 水印支持按目标页相对比例缩放,并支持以水印中心计算偏移(见上文 WatermarkSettings)。

渲染

  • 位图转换为 CMYK:Bitmap::ConvertFormat(..., e_DIBCmyk),可将 RGB / ARGB / RGB32 等位图直接转为 CMYK。
  • 增强 CMYK 页面渲染性能(同文档复测:Win32 约降 86%,Win64 约降 19%)。
  • 增强带 HENABLESKIP 的 halftone JBIG2 图像解码。

表单与注释

  • 按矩形区域批量获取标注:PDFPage::GetAnnotsAtRect / GetAnnotsAtDeviceRect,补齐既有按点命中接口;带 Hidden / NoView / Invisible 标志的标注不会返回。

标准与合规

  • PDF/A-4e / PDF/A-4f:新增验证与转换。请同步升级本版本配套的 Compliance 资源包。

无障碍

  • 无障碍检查、修复、导航与标签树:公开 AccessibilityChecker、AccessibilityFixer、AccessibilityNavigator、ReadingOrder、TagTreeEditor 等能力。
  • 增强 AutoTagging 结构识别:改善标题层级(如 H1/H2)识别不足、结构树过于扁平的问题,结果更接近常见阅读器识别效果。

文档与页面

  • 增强特定场景下文档打开性能(样例约降 99.7%)。
  • 从文件路径添加图像帧:Image::AddFrame 支持传入图像文件路径。
  • SVG / WMF(EMF)矢量图写入 PDF:通过 VectorGraphics 将 SVG / WMF(EMF)写入 PDF 页面或整册。

问题修复

转换

  • 修复了 DWG2PDF 在缺少特定字体时出现字体漂移、字号错乱的问题(可通过为引擎 Fonts 目录补充相应 .shx 字体规避/修复)
  • 修复了 Windows Java 环境下 DWG2PDF 因 ODA 导出组件与 JDK 自带运行库冲突导致执行异常/崩溃的问题
  • 修复了特定 DWG 图纸转换为 PDF 后部分文字乱码的问题
  • 修复了历史版本 DWG2PDF 转换结果出现乱码的问题
  • 修复了 DWG2PDF 转换后 PDF 丢失原图图层信息的问题
  • 修复了 DWG2PDF 转换后线宽等信息未正确保留的问题
  • 修复了 PDF 转 Word / Excel 时部分字体被非预期替换的问题
  • 修复了 Office2PDF 在缺少字体时错误提示 "No 3D module right" 的问题,改为准确的错误信息
  • 修复了 Linux 环境下特定 DWG 文件转换后文字乱码(显示为 "?")的问题
  • 修复了特定 DWG 转换后线条挤压叠在一起的问题
  • 修复了 Linux Java 在 OCR 与 PDF2Word 引擎组合流程中转换崩溃的问题

渲染

  • 修复了 knockout 透明组 shape 计算错误导致预览效果与 Adobe / WPS 不一致的问题
  • 修复了特定 XFA 文档渲染结果与 Adobe 不一致的问题
  • 修复了 Output Preview 场景下部分文字变粗、抗锯齿异常的问题(相对 v11.1 回归)
  • 修复了带边框的链接注释在渲染/转图时边框不显示的问题
  • 修复了开启模拟叠印(EnableSimulateOverprint)后效果与 Adobe 不一致的问题

文档与页面

  • 修复了为 PDF 增加嵌入字体的 FreeText 注释后,PDF/A 验证耗时过长且验证结果输出不完整的问题
  • 修复了 C# 向页眉/页脚写入部分 Unicode 符号时出现乱码的问题(C++ 侧无此问题)
  • 修复了结构异常 PDF 上 Bookmark::MoveTo 可能挂起或触发栈溢出的问题,改为更稳健地返回错误
  • 修复了将书签节点移动为父节点兄弟节点时结果不符合预期的问题
  • 修复了设置 PageBox 后重新读取页面宽高未变化的问题(需配合 PDFPage::Normalize() 等正确使用路径)

OCR

  • 修复了特定文档 OCR 后文字位置偏差与重影的问题
  • 修复了特定页面 OCR 后结果上下翻转的问题
  • 修复了特定页面 OCR 后出现翻转或旋转 90° 的问题

文本与内容

  • 修复了 PDFPage::AddText 偶发报错的问题
  • 修复了使用 TextSearchReplace 将日文替换为英文后文本不可见的问题
  • 修复了使用 SimSun-ExtB 创建文本对象时生僻字不显示,以及 IsCharSupported 误判的问题
  • 修复了 .NET Core 中 TextPage.GetText 返回结果与 .NET Framework 不一致的问题
  • 修复了 Font::IsCharSupported 对部分字体(如 HanaMinA)判断不准确的问题

平台

  • 修复了特定授权场景下在 Linux(如 Ubuntu 24)触发堆损坏类崩溃的问题
  • 修复了 Linux ARM 上 .NET 调用 TextPage.GetChars 报无法加载 fsdk.dll 的问题
  • 修复了并发编辑场景下文档对象错位/格式损坏的问题

安全与签名

  • 修复了水印字体执行 embed() 后字符串末尾字符位置不正确的问题
  • 修复了调用 EmbedFont 相关流程后,Adobe 打开特定页面报错的问题
  • 修复了 Linux 上从路径加载字体做中文平铺水印时水印不显示的问题

打印

  • 修复了应用退出时未调用 PrintManager.Release 可能触发 Access Violation 的问题
  • 修复了 PrintManager 在 release/close 路径上误用已关闭打印机句柄的问题

表单与注释

  • 修复了通过 SDK 添加的 Stamp 导出为 FDF 时缺少 /Length 条目的问题
  • 修复了 XFADoc::FlattenTo 丢失带变音符号字段值的问题

优化

  • 修复了压缩优化对已子集化/未嵌入字体处理不一致,导致部分字体被替换的问题

FLD / OFD

本节仅说明相对 v12.0 预览版之后的 FLD / OFD 变更。命名空间迁移、InitializeOFDEngine 移除、OFDPackage 打开模型、OfdConvert 互转等自 v11.1 起的变更不在本节范围内。PDF 能力变更见上文「PDF(桌面/服务器)」。

不兼容变更

相对预览版,正式版新增以下不兼容项。

Node.js npm 包名变更

中文区 npm 包名已调整。升级到 12.0 后,安装命令与代码中的 require / import 需同步修改:

| 旧包名 | 新包名 | | --- | --- | | @fuxinsoft/foxit-pdf-sdk-node | @fuxinsoft/fuxin-pdf-ofd-sdk-node |

# v12.0
npm i @fuxinsoft/fuxin-pdf-ofd-sdk-node
# 或
yarn add @fuxinsoft/fuxin-pdf-ofd-sdk-node

所需操作: 全局检索并替换旧包名;重新安装依赖后验证 Node.js 示例与现有工程可正常加载原生模块。

移除 Annot::SetLinkUri / Annot::GetActions

注释对象上的链接/动作 API 已移除,动作改挂在注释外观图元上:

| 项目 | 旧版本 | 12.0 起 | | --- | --- | --- | | 设置 URI / 取动作 | Annot::SetLinkUri / Annot::GetActions | 已移除 | | 推荐写法 | — | 在 OFDGraphicsObject 上 CreateActions,再添加 URIAction / GoToAction / GotoAAction 等 |

所需操作: 删除对已移除接口的调用,改为在外观图元上创建并添加动作。

移除动作派生类的单参构造

| 类型 | 旧版本 | 12.0 起 | | --- | --- | --- | | GoToAction / SoundAction / MovieAction 等 | 可用单参数构造函数 | 不再提供单参构造 |

所需操作: 从 Actions::AddAction / InsertAction 返回的 Action 再构造对应派生类。

移除 OFDLinearPackage

线性包公开类型已删除:

| 项目 | 旧版本 | 12.0 起 | | --- | --- | --- | | 类型 / 头文件 | OFDLinearPackage;ofd/fs_ofdlinearpackage.h | 已移除 | | 打开与加载 | 线性包专用入口 | 使用 OFDPackage |

所需操作: 改用 OFDPackage 完成打开与文档加载。

新增功能与增强

OFD 多语言绑定

  • 扩展 OFD 多语言绑定,并配套 Simple Demo / 代码生成。
  • 覆盖语言包括:Node.js、C#(.NET / .NET Core)、C、Python、Go 等(具体以各发布包清单为准)。

打开嵌入附件(GotoA)

  • 新增 GotoAAction:通过 SetAttachmentID 关联 Attachment::GetID(),在点击时打开已嵌入附件。
  • Outline::SetAttachmentID:大纲节点可直接关联附件(等价于 GotoA)。
  • Actions::InsertAction(type, index):按索引插入动作。
  • 动作挂在注释外观图元(OFDGraphicsObject)上,不再挂在 Annot 对象上。

其他说明

  • Action::e_ActionTypeSound / e_ActionTypeMovie 头文件注释标明当前不支持。
  • TextSearchCharInfo:当前无实质字段,仅作为 OFDPage::ReplaceCharacterBySearch 的参数类型使用。

问题修复

文档与页面(OFD)

  • 修复了解析 OFD 书签时中文字符乱码的问题。