Skip to content

Add HWP/HWPX input backend with layout provenance #3602

Open

Description

@myeolinmalchi

Requested feature

Add input support for Korean Hangul Word Processor documents (.hwp, .hwpx).

These formats are widely used in Korean public-sector, legal, academic, and enterprise workflows. Docling currently has no InputFormat for them, so users must convert HWP/HWPX outside Docling before they can use the CLI/API, exporters, chunkers, and the provenance-aware document model.

Ideally HWP/HWPX would flow through the normal Docling pipeline like the other supported formats, preserving the document's semantic structure where present (paragraphs, headings, lists, tables, pictures, formulas, footnotes/endnotes, page headers/footers, page breaks). The implementation approach is left to the maintainers.

Alternatives

Convert HWP/HWPX to an already-supported format outside Docling and ingest the result. This works today as a preprocessing step, but adds a manual conversion stage and gives Docling no direct control over warnings, errors, or provenance mapping.

Activity

  1. added 2 commits that reference this issue on Jun 14, 2026
    4942599
    b2d7d77
  2. myeolinmalchi commented on Jul 23, 2026

    @myeolinmalchi
    Author

    Update on the plan. I am splitting this into two parts so each PR stays reviewable and dependency-light.

    Part 1 (PR incoming): native HWPX backend, zero new dependencies.
    .hwpx is a zip+XML format (OWPML, KS X 6101), so it can be parsed with the stdlib and lxml alone. The PR registers InputFormat.HWPX and parses paragraphs, headings, lists, tables (including merged cells), and pictures natively, mirroring how the DOCX-family backends are scoped: modern XML format first, legacy binary format separately.

    Part 2 (follow-up): binary .hwp via rhwp.
    The binary format needs a real parser (CFB records, compression, legacy encodings), which is not a good fit for pure Python. I have proposed and implemented a versioned DocLang v0.6 XML export in rhwp, the actively maintained MIT-licensed Rust HWP parser (3.6k stars): edwardkim/rhwp#3131, edwardkim/rhwp#3132. Once that ships in a tagged rhwp release, a thin backend can route .hwp through it with version gating, or emit .dclg.xml for the existing InputFormat.XML_DOCLANG path (#3573).

    Design feedback is welcome here or on the Part 1 PR, in particular on whether the Part 2 integration should be a subprocess call to the rhwp CLI (as with the Tesseract CLI OCR engine) or an optional Python binding.

  3. etacbae6768-a11y commented on Nov 9, 2026

    @etacbae6768-a11y

    In case it helps with testing the HWPX backend (and the .hwp path later), we published a small set of generated test documents under CC0 1.0:
    https://github.com/etacbae6768-a11y/ttdu-hwp-plugins/tree/main/tests/samples/synth

    • 20 made-up documents, each saved as .hwp (HWP 5) and .hwpx: 40 files of 7 to 14 KB
    • 1 to 10 body paragraphs and 0 to 3 simple tables per document (up to 4 x 4 cells, some cells empty; no merged cells or nested tables), with mixed Korean and English text and symbols such as 「」, ※, ①, < and &
    • truth.json with the expected body paragraphs and table cell grids for each document

    The files were written by a seeded generator through the rhwp engine (MIT), so the content is synthetic and contains no personal data. Feel free to copy any of them into the test data if they are useful.

  4. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    Classification labels added: enhancement, priority:low.

    These labels are advisory. Maintainers can correct them. The workflow preserves these corrections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions