About this project

rhwp is an open-source HWP/HWPX viewer and editor based on Rust and WebAssembly. It was developed by referencing Hancom's public documents and explicitly states that it is an independent project with no affiliation, sponsorship, or approval from Hancom. Licensed under MIT. ## Document Processing Scope It parses HWP 5.0 binary (OLE2 compound files), HWPX (Open XML-based), and HML (HWPML 2.9/2.91, limited to verified structures). It handles paragraphs, tables, text boxes, images, equations, charts, headers/footers, master pages, and footnotes/endnotes. Rendering supports line spacing, indentation, alignment, tab stops, cell merging and border styles, cell formula calculation, multi-column layouts, paragraph numbering/bullets, vertical text, odd/even page separate headers, master pages, and object placement (in-line with text, like characters, or in front/behind text). Equations include fractions, radicals, superscripts/subscripts, matrices (MATRIX/PMATRIX/BMATRIX/DMATRIX), cases, EQALIGN, PILE series, large operators (INT/SUM/PROD etc.), REL/BUILDREL, limits, long division, Greek letters, and over 100 mathematical symbols. Page breaking handles multi-column splits, table row-level splits, and vpos-based paragraph position correction. ## Output and Renderer Backends The CLI exports SVG, PNG (requires native Skia feature), and PDF. PDF uses SVG-compatible paths by default, with an option to convert text to vector paths and byte reproducibility; a native Skia direct backend is optional. On the web, Canvas/CanvasKit rendering is used, with a common paint IR (PageRenderTree → PageLayerTree) where legacy/layered SVG, Canvas2D, CanvasKit replay, and native Skia backends share the same replay plane contract. The default request is Canvas2D; specifying `?renderer=auto` locks to CanvasKit only if the document passes a pre-check. Documents with complex shaping characters, old Hangul/PUA combinations, or structural layout mark display are fixed to Canvas2D entirely. Visual regression CI validates render diffs and PDF gates. ## Usage Paths - Web demo (GitHub Pages), Chrome/Edge/Firefox extensions, VS Code extension (including Open VSX) - npm packages: `@rhwp/editor` (iframe-embedded editor), `@rhwp/core` (WASM parser/renderer API) - CLI: export-svg, export-png, export-pdf, dump, dump-pages, info, capabilities - Built-in MCP server: with one line of configuration, use hwp_info, hwp_search, hwp_fill_fields, hwp_open·hwp_doc_* session tools in MCP hosts like Claude Code - Release binaries: linux x86_64, macOS x86_64/aarch64, windows x86_64 with SHA256SUMS.txt The web editor (rhwp-studio) provides text editing, formatting dialogs, table editing, and a hwpctl API layer compatible with Hancom Web Designer (30 Actions, ParameterSet/ParameterArray, Field API). Saving supports HWP edit save, HWPX/HML semantic-preserving save, and HWPX-to-HWP conversion. ## Development Approach Based on Rust 1.93.1, with WASM builds reproduced via Docker. It runs over 3,400 Rust tests and studio unit/e2e/visual regression CI. The project explicitly adopts a model where human task owners direct and own architectural decisions, using AI as an implementation multiplier, passing through plan approval, code review, and quality gates. Development logs accumulate in the mydocs/ directory. Contribution PRs are accepted against the devel branch, not main.