feat(ofd): convert fixed-layout documents to Markdown

LI
5d ago
+1098-38

Summary

  • Recognize OFD packages and .ofd paths across the Rust, Node.js, Python, and Wasm APIs.
  • Parse document bodies, pages, templates, and Unicode TextCode runs using anydoc's bounded ZIP/XML readers, without depending on ofdrw.
  • Preserve outline and large-font headings, bold/italic text, printed lists, bordered table grids, and URI links in the shared document model and Markdown output.
  • Report encrypted packages and image-only pages explicitly; document the fixed-layout inference limits.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --all-features --locked --offline -- -D warnings
  • cargo test --locked --offline
  • npm ci && npm run build && npm test in node/ (22 tests; generated declarations checked)
  • Built the Python 3.13 wheel with maturin and ran python -m unittest discover -s python/tests (13 tests)
  • cargo clippy -p anydoc-wasm --target wasm32-unknown-unknown --locked --offline -- -D warnings
  • wasm-pack build wasm --release --target web --scope firecrawl and node --test wasm/test.mjs (8 tests)

Scope notes

OFD is fixed-layout: larger-font headings and complete bordered table grids use conservative layout inference. Borderless/irregular tables, images, vector drawings, non-link annotations, and OCR are not converted. Image-only pages return NeedsOcr rather than incomplete Markdown.

Closes #208