feat(render): hwp/hwpx/doc/xls/ppt 네이티브 렌더 — 레거시 포맷 정규화 계층 - #1
Merged
Conversation
documents/legacy — 5개 레거시/한글 포맷을 실제 스펙 파싱으로 OOXML 에
정규화한 뒤(hwp/hwpx/doc→docx, xls→xlsx, ppt→pptx) 기존 네이티브 페이지
엔진(docx_pages/xlsx_pages/pptx→svg)이 렌더한다. LibreOffice 등 외부
프로세스 없음 — 이 저장소의 native-render 원칙 그대로.
- hwp_convert: HWP 5.0 바이너리 — OLE + zlib 레코드 스트림. 레코드
헤더(tagid/level/size), DocInfo CHAR_SHAPE(크기/굵게/기울임/밑줄/색),
BodyText PARA_TEXT(컨트롤 문자 크기표)/PARA_CHAR_SHAPE(런 경계)/
CTRL_HEADER('tbl ')+TABLE+LIST_HEADER(표 셀)/PAGE_DEF(용지·여백).
암호/배포용 파일은 정직하게 거절.
- hwpx_convert: OWPML(zip+XML) — header.xml charPr/paraPr 해석(런 스타일),
표(cellAddr/cellSpan 병합), BinData 이미지, pagePr 기하. 네임스페이스
프리픽스 비의존(로컬네임 매칭).
- doc_convert: Word97 — FIB→Clx piece table 로 유니코드/압축 혼합 조각을
CP 순서로 복원(문단/페이지 나눔/필드 명령부 제거·결과 보존).
- xls_convert: BIFF8 — SST(CONTINUE 분절 grbit 규칙 포함)/FONT/XF/FORMAT/
BOUNDSHEET/셀(NUMBER·RK·MULRK·LABELSST·FORMULA 캐시값·BOOLERR)/열너비/
행높이/병합 → openpyxl. BIFF5 는 거절.
- ppt_convert: PPT97 — 레코드 트리에서 SlideListWithText 의 슬라이드별
TextHeader/Chars/Bytes 를 모아 pptx 슬라이드로(제목/본문, 슬라이드 크기).
- simple.py: _fmt_of/_normalize_legacy — render_doc/preview_doc 이 레거시
확장자를 받아 정규화 후 같은 경로를 탄다 (.converted.* 캐시).
테스트 11건 — 포맷별 스펙을 그대로 따르는 손조립 픽스처(미니 CFB v3
라이터 포함: 스토리지 계층 + 정규 섹터 체인) → SVG 렌더까지 E2E.
스타일 보존(굵게/색), 표 셀, piece table 재조립, 필드 처리, BIFF
CONTINUE, 슬라이드 수 검증. 781 passed (기준선 770 + 11) 회귀 0,
hwp/xls/ppt PNG 래스터 스모크 통과.
레퍼런스: reference_data/pyhwp (HWP 태그/레코드 대조),
reference_data/xlrd (BIFF 대조) — 코드 복제 없음, 스펙 확인용.
This was referenced Aug 31, 2026
Merged
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.
요약
documents/legacy— 5개 레거시/한글 포맷을 실제 스펙 파싱으로 OOXML에 정규화(hwp/hwpx/doc→docx, xls→xlsx, ppt→pptx)한 뒤 기존 네이티브 페이지 엔진이 렌더한다. LibreOffice 등 외부 프로세스 없음 — native-render 원칙 그대로.render_doc('x.hwp', to='png'|'svg'|'pdf')가 그냥 동작한다.검증
레퍼런스: reference_data/pyhwp·xlrd (스펙 대조용, 코드 복제 없음)
🤖 Generated with Claude Code