ofd-wasm

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Unlicense Imports: 0 Imported by: 0

README

OFD WASM

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

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

截图

OFD WASM 网页阅读器

OFD WASM 网页阅读器 双页模式

示例使用 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

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