command
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Sep 12, 2026
License: Unlicense
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
OFD WASM
OFD WASM 将 OFD 文档解析和渲染能力提供给浏览器 JavaScript 使用。
浏览器阅读器示例和可直接部署的 Web 页面位于 web 目录。
截图


示例使用 worker.js 将解析和渲染放在 Web Worker 中;页面使用 IntersectionObserver 按可视区域附近懒加载,并分别缓存正文页和缩略图的 Blob URL。工具栏支持 50% 到 300% 缩放,页面缩放时按 DPI 重新渲染正文,缩略图保持 36 DPI。
快速开始
在仓库根目录执行:
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
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.