Repository navigation
F-Office v0.2.0
Memory efficiency, streaming PDF export, zero-copy browser file I/O, and the new @f-office/viewer drop-in browser component.
Install
CLI (foffice) — bundles metric-compatible open fonts from Compatifont (OFL-1.1):
# From crates.io
cargo install f-office-cli
# Or via cargo-binstall / prebuilt archives attached to this release
cargo binstall f-office-cli
# Or via Homebrew (macOS and Linux)
brew install osolmaz/tap/fofficeRust library:
cargo add f-officeJavaScript / TypeScript (browser and Node.js):
npm install @f-office/wasm @compatifont/fonts
# Drop-in browser viewer component:
npm install @f-office/viewer @f-office/wasm @compatifont/fontsWhat's new in v0.2.0
- Handle-based lazy images (
ImageRef):Document::opennow reads only image headers for layout dimensions instead of eagerly pinning image byte buffers in memory; rasterization and PDF export decode images on demand behind a bounded LRU cache. - Flat-arena XML, streaming
<w:body>, and compact text index (TextMap):f-office-xml::Documentuses flat arenas and a single string buffer while preserving exact byte spans forfoffice edit;<w:body>top-level blocks stream during layout;Documentretains a compact reading-orderTextMapinstead of fullVec<PlacedLine>. - Streaming PDF export: Replaced in-memory PDF assembly with a streaming
Write-based PDF emitter (Document::write_pdf_to,foffice convert --to pdf, and@f-office/wasmwritePdfTo/ workerwritePdfBlob). - Zero-copy browser & random-access file I/O: Added
RandomAccessRead+Package::open_source/Document::open_source, pluscreateBlobSource(File.slice()/FileReaderSync),createOpfsSource(FileSystemSyncAccessHandle),openDocxFile, andopenDocxOpfsin@f-office/wasmso large DOCX files do not need to be copied into WASM linear memory. - New
@f-office/viewerpackage: Drop-in<f-office-viewer>Web Component andcreateDocxViewer()API with virtualized page scrolling, HiDPI tiledrenderRegionrendering + bounded LRU tile cache, zoom/fit modes, selectable text layer, on-demand@compatifont/fontsloading + worker-recycle font replay, and streaming PDF export. - Layout and graphics fixes: DrawingML
a:grpFillgroup fill inheritance, improved EMF/WMF shape and gradient rendering, math operator spacing fixes, and updated logo spacing.
Notes
- Licensed under Apache-2.0 (bundled Compatifont font files are OFL-1.1).
- Building from source requires Rust 1.100 or newer.
@f-office/wasmuses WebAssembly SIMD (Chrome 91+, Firefox 89+, Safari 16.4+, Node.js 18+).