ofd-wasm

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: Unlicense Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

OFD WASM

OFD WASM 将 OFD 文档解析和渲染能力提供给浏览器 JavaScript 使用。

使用阅读器处理不可信或敏感文档前,请阅读项目根目录的 免责声明。在线示例不替代生产环境的文件安全、权限控制和隐私保护措施。

浏览器阅读器示例和可直接部署的 Web 页面位于 web 目录。

截图

OFD WASM 网页阅读器

OFD WASM 网页阅读器 双页模式

示例使用 worker.js 将解析和渲染放在 Web Worker 中;页面使用 IntersectionObserver 按可视区域附近懒加载,并分别缓存正文页和缩略图的 Blob URL。工具栏支持 50% 到 300% 缩放;默认正文按 72 DPI 渲染并在缩放时使用 CSS 放大,也可以开启“清晰度优先”按缩放比例重新渲染正文,缩略图保持 15 DPI。底层 renderPage 和 renderPages API 支持通过 format 配置输出 PNG、JPG 或 SVG,默认输出 PNG。

快速开始

在仓库根目录执行:

make build-wasm
python3 -m http.server 8080 --directory cmd/ofd-wasm/web

然后打开 http://localhost:8080,选择一个 .ofd 文件即可开始阅读。

浏览器不能通过 file:// 直接加载 WASM,运行阅读器时需要使用 HTTP 服务。完整的阅读器功能、WASM API、Worker 协议和部署说明见 web/README.md。

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL