Skip to content

Releases

HWPExport v1.0.0

Choose a tag to compare

@civilian7 civilian7 released this 07 Aug 00:42

A Windows console tool that exports HWP (Hancom Word Processor) documents to
per-page images or a single PDF.

Downloads

File Contents
HWPExport-v1.0.0-win64.zip Both executables, the approval module, README (EN/KO), and license
exam_kor.hwp Sample document for testing (A3, 20 pages) — see the copyright note below

Unzip and run — there is no installer.

HWPExportC.exe report.hwp out -f png -d 150     # one PNG per page
HWPExportC.exe report.hwp out -f pdf            # whole document as one PDF
HWPExportC.exe report.hwp out -f png --json     # structured output for automation

Hancom Office (한/글) must be installed. There is no public rendering library for
the HWP format, so only Hancom's own engine can draw the pages.

What's in the package

  • HWPExportC.exe (165 KB) — C build; rebuildable with the free Visual Studio Build Tools
  • HWPExport.exe (2.3 MB) — Delphi build, for dropping into an existing Delphi codebase
  • FilePathCheckerModule.dll (1.5 KB) — suppresses Hancom's file-access prompt; registered automatically
  • register_module.ps1 — register / unregister / inspect that module manually

Both executables share the same options, exit codes and output.
See the README for details
(한국어).

Features

Formats — BMP, GIF, PNG, JPG (with quality control), and PDF. Page ranges (-s/-e)
and resolution (-d) are configurable.

Automation-friendly output — --json emits a structured result. It is always UTF-8,
so piping never mangles text, and even argument errors come back as JSON so a parser
never breaks.

{
  "ok": true,
  "source": "C:\\docs\\report.hwp",
  "format": "png",
  "pages": 2,
  "files": ["C:\\docs\\out\\report_p0001.png", "..."],
  "error": null,
  "exitCode": 0
}

Exit codes — failures are distinguished from 0 to 12 (2 = file not found,
3 = Hancom missing, 11 = timeout, 12 = another run in progress, and so on).

Hang protection (--timeout) — a modal dialog in Hancom blocks COM calls forever.
On timeout the tool terminates only the Hancom process it started itself, leaving any
window the user opened untouched.

Concurrency control (--wait) — Hancom automation cannot run twice at once, so runs
are serialised through a named mutex. The C and Delphi builds share the same lock.

Resolution metadata fixes — BMPs produced by Hancom carry garbage resolution headers,
which makes Explorer thumbnails look horizontally squashed. The BMP header, PNG pHYs
chunk and JPEG JFIF fields are all corrected, so an A3 page at 150 DPI reports exactly
1754 × 2480 px / 297 × 420 mm.

Known limitations

  • Hancom is a UI application, so it does not work in a Windows service or session 0.
  • Only one export can run at a time; process documents sequentially.
  • The approval module must match Hancom's bitness (the bundled DLL is x86, matching
    Hancom Office 2020). For 64-bit Hancom, rebuild with build.ps1 -ModulePlatform Win64.

The pitfalls of Hancom OLE automation and how they were solved are documented in the
README.

License

Noncommercial use only — PolyForm Noncommercial License 1.0.0.

You may use, modify and redistribute this for personal, research, educational, charitable
and government purposes. Commercial use requires a separate license from the copyright
holder; open an issue to get in touch.

This covers HWPExport itself. Hancom Office is separate proprietary software with its own
license, which you are responsible for holding.

Sample document copyright

exam_kor.hwp is the Korean Language section of the 2025 College Scholastic Ability
Test
(2025학년도 대학수학능력시험 국어 영역 문제지).

Copyright (c) Korea Institute for Curriculum and Evaluation (한국교육과정평가원).
All rights reserved.

It is attached only so the tool's behaviour can be reproduced, is not covered by the
PolyForm license above, and all rights remain with its copyright holder.