Read HWPX into the document model: HWP/HWPX → DOCX without LibreOffice - #13
Merged
Merged
Conversation
HwpxReader is the inverse of HwpxWriter: it reads an .hwpx package into HDocument, so HWPX (and HWP, which rhwp turns into HWPX first) can later be written as DOCX, HTML or EPUB without Hancom Office or LibreOffice. It is not registered as a converter yet; a reader registry picks it up by format id. It reads files from 한글, rhwp's export-hwpx and Filee's own writer: elements are matched by local name, hp:switch takes the exact HwpUnitChar branch (else halves the doubled hp:default / legacy values), and every IDRef is resolved through header.xml. Sections, page setup (NARROWLY = landscape), columns, headers/footers, automatic page numbers, complete paragraph and character shapes, outline headings, numberings and bullets, fields and hyperlinks, bookmarks, notes, tables (spans, widths, heights, borders, fills, header rows, captions, nesting), pictures, shapes, text boxes and groups are kept. Objects without a place in the model are skipped and counted; encrypted and DRM-wrapped files stop with a clear error. Tests write documents from the DOCX, Markdown, XLSX and PPTX readers as HWPX, read them back and compare, then write and read again for an identical model; they also read rhwp's HWPX, the template saved by 한글, a package in the style 한글 writes, and time a 100-page document. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/ENGINES.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A reader for HWPX files saved by 한글, rhwp and Filee. HWP is converted to HWPX by rhwp first, so HWP → DOCX no longer needs LibreOffice.
🤖 Generated with Claude Code