### Install Dependencies and Serve Documentation Locally
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/documentation-site.md
Installs documentation dependencies and starts a local development server for previewing the documentation site.
```powershell
python -m pip install -r requirements-docs.txt
mkdocs serve
```
--------------------------------
### Example Cell Write with Text and Image
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Demonstrates how to write text and insert an image into a specific cell within an HWPX document. The `clearCell` attribute ensures the cell content is replaced.
```xml
|
Existing cell text
Replacement cell text
|
```
--------------------------------
### Example Cell Image Insertion
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Shows how to insert an image into a cell using a path relative to the map XML. The `clearCell` attribute is set to true to replace existing content.
```xml
```
--------------------------------
### Check OpenHwp Automation CLI Version
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/index.md
Check the version of the OpenHwp Automation CLI. This command verifies the installed CLI version.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe version
```
--------------------------------
### Add Header/Footer Text
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Creates a minimal text body for a header/footer and a matching reference within an HWPX file. It prevents duplicate references and does not modify rich content or section page setup.
```powershell
& $cli add-header-footer-text C:\temp\template.hwpx C:\temp\header-footer-text.hwpx --kind footer --section section0 --id-ref footer-odd --apply-page-type ODD --text "Odd footer" --report C:\temp\header-footer-text.md
```
--------------------------------
### Get and Set Field Values
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Retrieves the value of a specific field from a form HWP file and sets a new value for a field, saving the result to a new file.
```powershell
& $cli field-get '
' 'FIELD_NAME'
```
```powershell
& $cli --visible field-set '' 'FIELD_NAME' 'updated text' 'test\out\form-out.hwpx'
```
--------------------------------
### Example Paragraph Anchor Text Replacement
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Illustrates how to replace the text of a paragraph anchor. The `replaceAnchorText` attribute is set to true to update the anchor's text.
```xml
Existing paragraph text
Replacement paragraph text
```
--------------------------------
### Add Header/Footer Text Body
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Adds a new text body and reference to a header or footer with a section-unique `idRef`. This command is for creating minimal text bodies; rich objects and section page setup require separate operations.
```powershell
& $cli add-header-footer-text 'C:\temp\template.hwpx' 'C:\temp\header_footer_text.hwpx' --kind footer --section section0 --id-ref footer-odd --apply-page-type ODD --text 'Odd footer' --report 'C:\temp\header_footer_text.md'
```
--------------------------------
### Set Location and Build Project
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Navigates to the project directory and builds the Release configuration of the project. It then constructs the full path to the CLI executable.
```powershell
Set-Location -LiteralPath 'C:\Users\ZARATHU11\codex\openhwpsdk'
.uild.cmd Release
$cli = Join-Path (Get-Location) 'src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe'
```
--------------------------------
### Basic CLI Operations
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Demonstrates basic file operations like creating, copying, and reading HWPX files, as well as exporting to PDF.
```powershell
$cli = "src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe"
& $cli version
& $cli new-text C:\temp\hello.hwpx "Hello from OpenHwp"
& $cli copy-save C:\temp\in.hwpx C:\temp\out.hwpx
& $cli doc-info C:\temp\in.hwp
& $cli read-text C:\temp\in.hwp
& $cli read-page C:\temp\in.hwp 1
& $cli --visible export-pdf C:\temp\in.hwpx C:\temp\out.pdf
```
--------------------------------
### Create New HWPX Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/README.md
Generates a new HWPX document with initial text content using the CLI.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe new-text C:\temp\hello.hwpx "Hello from OpenHwp"
```
--------------------------------
### Create Output Directory
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/README.md
Creates a scratch directory for output files before running build or CLI commands.
```bat
mkdir C:\temp
```
--------------------------------
### Build Static Documentation Site
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/documentation-site.md
Builds the static version of the documentation site, cleaning previous builds and specifying the output directory.
```powershell
mkdocs build --clean --site-dir site
```
--------------------------------
### Fill R&D Startup Submission Template
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Fills a submission template with content from a Markdown file using a specific profile. Use --report for detailed logs.
```powershell
& $cli fill-submission-template '' '' 'test\out\submission_filled.hwpx' --profile r-and-d-startup-2026 --asset-root '' --image-mode package --report 'test\out\submission_filled_report.md'
```
--------------------------------
### Build OpenHWP SDK CLI Release x86
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Builds the Release x86 version of the OpenHWP SDK CLI. Ensure you are in the correct repository path before running.
```powershell
Set-Location -LiteralPath 'C:\Users\ZARATHU11\codex\openhwpsdk'
.\build.cmd Release
```
--------------------------------
### Create New HWPX Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Creates a new HWPX document with specified content and path using the CLI.
```powershell
& $cli new-text C:\temp\hello.hwpx "Hello from OpenHwp"
```
--------------------------------
### Call OpenHWP SDK CLI Version
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Locates and executes the OpenHWP SDK CLI to display its version. This assumes the CLI has been built successfully.
```powershell
$cli = Join-Path (Get-Location) 'src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe'
& $cli version
```
--------------------------------
### Build Release Version
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Builds the Release version of the CLI from the repository root. The executable is placed in a specific release directory.
```bat
build.cmd Release
```
--------------------------------
### Apply Form Map using Package Mode
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Applies a form map to an HWPX template using package mode for COM-free text writes and package-level image embedding. Generates an apply report and a layout report.
```powershell
& $cli apply-form-map --package '' 'test\out\template_form_map_filled.xml' 'test\out\template_form_map_package.hwpx' --report 'test\out\template_form_map_package_apply.md'
```
--------------------------------
### List Controls in Reference HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists all controls within a reference HWPX file and saves the inventory to a markdown file.
```powershell
& $cli --visible list-controls C:\temp\reference.hwpx C:\temp\reference-controls.md
```
--------------------------------
### Create New HWPX Table
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Creates a new simple table within an HWPX file. Requires an existing unmerged top-level table for cloning defaults. Fails if no safe reference table exists.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe table-create-package "" "C:\temp\openhwpsdk-out\new_table.hwpx" --rows 2 --cols 3 --text "Header A|Header B|Header C;Value 1|Value 2|Value 3" --report "C:\temp\openhwpsdk-out\new_table_report.md"
```
--------------------------------
### Create HWPX Table Package
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Creates a new table within an HWPX file with specified dimensions and initial text content. A report of the creation process is generated.
```powershell
& $cli table-create-package C:\temp\template.hwpx C:\temp\new-table.hwpx --rows 2 --cols 3 --text "Header A|Header B|Header C;Value 1|Value 2|Value 3" --report C:\temp\new-table-report.md
```
--------------------------------
### Inspect Pictures in HWPX File
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/image-replacement.md
Use the CLI to list pictures within an HWPX file and generate an inventory report. This helps identify picture indices and properties before replacement.
```powershell
$cli = "src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe"
& $cli list-pictures C:\temp\template.hwpx C:\temp\picture-inventory.md
```
--------------------------------
### List Controls in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Lists all controls within a reference HWPX file and saves the output to a Markdown file. Useful for identifying controls before copying.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible list-controls "" "C:\temp\openhwpsdk-out\reference_controls.md"
```
--------------------------------
### List Pictures from HWPX File
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Lists pictures from a specified HWPX file and saves the inventory to a markdown file. This provides a COM-free picture inventory including XML part, package-order graphical-object index, image reference, and pixel size.
```powershell
& $cli list-pictures 'C:\temp\template.hwpx' 'C:\temp\picture_inventory.md'
```
--------------------------------
### Form Map Workflow - Application
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Applies a form map to an HWPX template, with options for HWP-backed or package mode.
```powershell
& $cli --visible apply-form-map C:\temp\template.hwpx C:\temp\template-form-map.xml C:\temp\filled.hwpx --report C:\temp\filled-apply.md
& $cli apply-form-map --package C:\temp\template.hwpx C:\temp\template-form-map.xml C:\temp\filled-package.hwpx --report C:\temp\filled-package-apply.md
```
--------------------------------
### List Pictures in Reference HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists all pictures within a reference HWPX file and saves the inventory to a markdown file.
```powershell
& $cli list-pictures C:\temp\reference.hwpx C:\temp\reference-pictures.md
```
--------------------------------
### List Header/Footer in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists header and footer information from an HWPX file and saves the inventory to a markdown file.
```powershell
& $cli list-header-footer C:\temp\template.hwpx C:\temp\header-footer-inventory.md
```
--------------------------------
### List Fields with COM
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Lists fields within an HWPX file, merging with HWP COM field-list output when the document is opened in HWP.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe list-fields "" "C:\temp\field_inventory.md" --com
```
--------------------------------
### List Pictures in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists all pictures within an HWPX file and saves the inventory to a markdown file.
```powershell
& $cli list-pictures C:\temp\template.hwpx C:\temp\picture-inventory.md
```
--------------------------------
### List Fields with COM
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Lists fields and forms from an HWPX file, merging package field/form data with HWP COM field-list output into a single report. Use the `--com` flag for this integrated report.
```powershell
& $cli --visible list-fields '' 'C:\temp\field_inventory.md' --com
```
--------------------------------
### List Markdown Tables in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Lists all Markdown tables found within a specified HWPX source file.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe markdown-table-list ""
```
--------------------------------
### Form Map Workflow - Extraction and Probing
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Extracts a form map from an HWPX template and probes it for analysis.
```powershell
& $cli extract-form-map C:\temp\template.hwpx C:\temp\template-form-map.xml
& $cli --visible probe-form-map C:\temp\template.hwpx C:\temp\template-form-map.xml C:\temp\template-probe.md
```
--------------------------------
### Fill HWPX Table from Markdown
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Fills an existing HWPX table with data from a Markdown table without recreating the table structure. Requires specifying table indices and optional row/column offsets.
```powershell
& $cli --visible fill-markdown-table '' '' 'test\out\table-out.hwpx' [startRow] [startCol] [skipMarkdownRows] [maxRows] [maxCols]
```
--------------------------------
### List Fields in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists fields within an HWPX file, including package write contracts. It reports which fields are supported for writing and which are 'skipped_unsafe'.
```powershell
& $cli --visible list-fields C:\temp\template.hwpx C:\temp\field-inventory.md --com
```
--------------------------------
### HWP COM Diagnostics
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Runs COM diagnostics for HWP, useful before workflows that depend on the desktop editor.
```powershell
& $cli --visible diagnose-com
& $cli --visible diagnose-com C:\temp\in.hwpx
```
--------------------------------
### List Header and Footer Information
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Generates an inventory of headers and footers from a specified HWPX file, saving the report to a markdown file. This provides a focused, section-aware report including counts of text, tables, pictures, and shapes.
```powershell
& $cli list-header-footer 'C:\temp\template.hwpx' 'C:\temp\header_footer_inventory.md'
```
--------------------------------
### Apply Form Map with HWP Automation
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Applies a form map to an HWPX template using HWP automation, saving the result to a new file and generating an apply report. This method is preferred when editor-backed behavior is crucial.
```powershell
& $cli --visible apply-form-map '' 'test\out\template_form_map_filled.xml' 'test\out\template_form_map_applied.hwpx' --report 'test\out\template_form_map_apply.md'
```
--------------------------------
### Copy from Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Copies a source element (e.g., an image) from a reference HWPX document to a target HWPX document. It is recommended to run 'probe-copy-from-doc' beforehand and validate the copied output.
```powershell
& $cli --visible copy-from-doc C:\temp\reference.hwpx C:\temp\target.hwpx C:\temp\copied.hwpx --source image:0 --target doc-end --report C:\temp\copy-report.md
```
--------------------------------
### List Header and Footer Inventory
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Lists the inventory of headers and footers within an HWPX template, including placement and text counts.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe list-header-footer "C:\temp\template.hwpx" "C:\temp\header_footer_inventory.md"
```
--------------------------------
### Add Header/Footer Reference
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Adds a reference to an existing header or footer for a specific page type in an HWPX file.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe add-header-footer-reference "C:\temp\template.hwpx" "C:\temp\header_footer_reference.hwpx" --kind footer --section section0 --id-ref footer-ref --apply-page-type ODD --report "C:\temp\header_footer_reference.md"
```
--------------------------------
### Scan HWPX Features
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Scans a directory for HWPX files and inventories their features, saving the report to a markdown file.
```powershell
& $cli scan-hwpx-features C:\temp\hwpx-samples C:\temp\feature-scan.md
```
--------------------------------
### Export HWPX to PDF
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Exports an HWPX document to a PDF file using the CLI. The --visible flag can be used for debugging.
```powershell
& $cli --visible export-pdf C:\temp\hello.hwpx C:\temp\hello.pdf
```
--------------------------------
### Apply Filled Form Map in Package Mode
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Applies a filled form map in package mode for COM-free writes. This preserves package entries, applies XML text changes, embeds images as package objects, and runs layout validation.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe apply-form-map --package "" "C:\temp\openhwpsdk-out\template_form_map_filled.xml" "C:\temp\openhwpsdk-out\template_form_map_package_applied.hwpx" --report "C:\temp\openhwpsdk-out\template_form_map_package_apply.md"
```
--------------------------------
### Copy Content from HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Copies content from a reference HWPX document to a target HWPX document. Generates a report of the copy operation. Ensure to use 'probe-copy-from-doc' first.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible copy-from-doc "" "" "C:\temp\openhwpsdk-out\copy_from_doc.hwpx" --source image:0 --target doc-end --report "C:\temp\openhwpsdk-out\copy_from_doc.md"
```
--------------------------------
### Export HWPX to PDF
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Exports an HWPX file to a PDF format for visual inspection.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible export-pdf "" "C:\temp\openhwpsdk-out\template_original.pdf"
```
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible export-pdf "C:\temp\openhwpsdk-out\cell_fill_education_2rows.hwpx" "C:\temp\openhwpsdk-out\cell_fill_education_2rows.pdf"
```
--------------------------------
### Set CLI Path and Check Version
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Sets a variable for the CLI executable path and checks its version. Useful for shorter commands in PowerShell.
```powershell
$cli = "src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe"
& $cli version
```
--------------------------------
### Fill Submission Template with Profile
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Fills a submission template using a dedicated profile, processing Markdown image lines and embedding images. Various options control image handling and table rendering.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe fill-submission-template "" "" "C:\temp\openhwpsdk-out\submission_filled.hwpx" --profile r-and-d-startup-2026 --asset-root "" --image-mode package --report "C:\temp\openhwpsdk-out\submission_filled_report.md"
```
--------------------------------
### Visual Smoke Testing - Corpus Scan with Failure Expectation
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Runs a visual smoke test with specific expectations for export failures and strict cleanup. Use for known non-renderable fixtures.
```powershell
& $cli --visible visual-smoke-corpus C:\temp\hwpx-corpus C:\temp\visual-smoke C:\temp\visual-smoke\visual-smoke-report.md --expect-export-failure "known-nonrenderable.hwpx=1:Failed to open" --strict-cleanup
```
--------------------------------
### Submission Template Profile Filling
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Fills a submission template with profile and asset root configurations. Use specific modes for markdown tables and image handling.
```powershell
& $cli fill-submission-template C:\temp\template.hwpx C:\temp\source.md C:\temp\submission-filled.hwpx --profile r-and-d-startup-2026 --asset-root C:\temp --image-mode package --report C:\temp\submission-filled-report.md
```
--------------------------------
### Add Header/Footer Text
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Adds a new text body and reference to a header or footer in an HWPX file for a specific page type.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe add-header-footer-text "C:\temp\template.hwpx" "C:\temp\header_footer_text.hwpx" --kind footer --section section0 --id-ref footer-odd --apply-page-type ODD --text "Odd footer" --report "C:\temp\header_footer_text.md"
```
--------------------------------
### Fill Markdown Table in HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Fills a Markdown table within an HWPX file with specified row and column data. This command is visible and requires source and destination HWPX files.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible fill-markdown-table "" "" "C:\temp\openhwpsdk-out\cell_fill_education_2rows.hwpx" 8 3 1 0 1 2 5
```
--------------------------------
### Scan HWPX Features
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Scans a directory for HWPX authoring features and saves the report to a markdown file. Use this to determine what HWPX features are present in a file or corpus.
```powershell
& $cli scan-hwpx-features 'C:\temp\hwpx-samples' 'C:\temp\hwpx_feature_scan.md'
```
--------------------------------
### Probe Copy from Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Probes the process of copying a source element (e.g., an image) from one HWPX document to a target document. It reports the outcome without performing the actual copy, useful for validation before mutation.
```powershell
& $cli --visible probe-copy-from-doc C:\temp\reference.hwpx C:\temp\target.hwpx --source image:0 --target doc-end --report C:\temp\copy-probe.md
```
--------------------------------
### Apply Filled Form Map via HWP Automation
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Applies a filled form map to a template HWPX file using HWP automation, requiring editor-backed behavior. An optional report can be generated for detailed write attempts.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible apply-form-map "" "C:\temp\openhwpsdk-out\template_form_map_filled.xml" "C:\temp\openhwpsdk-out\template_form_map_applied.hwpx"
```
--------------------------------
### Probe Copying Content from HWPX
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Probes the process of copying content from a source HWPX to a target HWPX without performing the actual mutation. Generates a report detailing the probe results. Use before performing actual copy operations.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible probe-copy-from-doc "" "" --source image:0 --target doc-end --report "C:\temp\openhwpsdk-out\copy_probe.md"
```
--------------------------------
### Field List and Existence Check
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Retrieves a raw list of fields within a form HWP file and checks if a specific field exists.
```powershell
& $cli field-list-raw ''
```
```powershell
& $cli field-exists '' 'FIELD_NAME'
```
--------------------------------
### Read Text from HWPX Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Reads and displays the text content from an HWPX document using the CLI.
```powershell
& $cli read-text C:\temp\hello.hwpx
```
--------------------------------
### Validation Commands
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Validates layout and content of HWPX files, with options for reporting and content requirements.
```powershell
& $cli validate-layout C:\temp\template.hwpx C:\temp\filled.hwpx C:\temp\layout-report.md
& $cli validate-content C:\temp\filled.hwpx C:\temp\content-report.md --require "required text"
```
--------------------------------
### Diagnose HWP COM Environment
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/getting-started.md
Diagnoses the local HWP COM environment using the CLI. Use --visible mode for debugging COM-related issues.
```powershell
& $cli --visible diagnose-com
```
--------------------------------
### List Markdown Tables in a Source File
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Lists all Markdown tables found within a specified Markdown source file. This is useful for inspecting tables before filling existing cells.
```powershell
& $cli markdown-table-list ''
```
--------------------------------
### Diagnose HWP COM with CLI
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/index.md
Diagnose HWP COM issues using the OpenHwp Automation CLI. The --visible flag ensures the HWP application is shown during the diagnostic process.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible diagnose-com
```
--------------------------------
### Add Header/Footer Reference
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Adds a reference to an existing header or footer for a specific page type. This command is used when an existing `idRef` can be reused and rejects duplicate references for the same `kind`, `section`, and `applyPageType`.
```powershell
& $cli add-header-footer-reference 'C:\temp\template.hwpx' 'C:\temp\header_footer_reference.hwpx' --kind footer --section section0 --id-ref footer-ref --apply-page-type ODD --report 'C:\temp\header_footer_reference.md'
```
--------------------------------
### Set Header/Footer Text
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Replaces the text of an existing header or footer anchor in an HWPX file and reports changes.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe set-header-footer-text "C:\temp\template.hwpx" "C:\temp\header_footer_text_write.hwpx" --kind header --section section0 --anchor "Header fixture" --text "Updated Header Fixture" --report "C:\temp\header_footer_text_write.md"
```
--------------------------------
### Diagnose COM Issues
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Executes the COM diagnosis command for the HWP automation. Includes options for specifying an input file and setting a COM timeout for troubleshooting hangs.
```powershell
& $cli --visible diagnose-com
```
```powershell
& $cli --visible diagnose-com ''
```
```powershell
& $cli --visible --com-timeout-ms 120000 diagnose-com ''
```
--------------------------------
### List Markdown Table
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Lists the tables present in a markdown file.
```powershell
& $cli markdown-table-list C:\temp\input.md
```
--------------------------------
### Export Document to PDF
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Exports the specified HWP document to a PDF file. This operation can be run in visible mode.
```powershell
& $cli --visible export-pdf '' 'test\out\input.pdf'
```
--------------------------------
### Visual Smoke Testing - Basic Corpus Scan
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Performs a visual smoke test on an HWPX corpus, exporting files and generating a report.
```powershell
& $cli --visible visual-smoke-corpus C:\temp\hwpx-corpus C:\temp\visual-smoke C:\temp\visual-smoke\visual-smoke-report.md
```
--------------------------------
### Field Command Operations
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Checks for field existence, retrieves field values, and sets field values in HWPX files.
```powershell
& $cli field-exists C:\temp\form.hwp TEST
& $cli field-get C:\temp\form.hwp TEST
& $cli field-set C:\temp\form.hwpx TEST "updated text" C:\temp\form-out.hwpx
```
--------------------------------
### Read Document Information and Content
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/references/windows-cli-recipes.md
Retrieves general document information, extracts plain text from the entire document, or extracts text from a specific page. Prefer file output for Korean text.
```powershell
& $cli doc-info ''
```
```powershell
& $cli read-text '' 'test\out\input_text.txt'
```
```powershell
& $cli read-page '' 1 'test\out\page_001.txt'
```
--------------------------------
### Scan HWPX Feature Coverage
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Scans an HWPX file or directory to inventory its features and coverage, generating a detailed report.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe scan-hwpx-features "C:\temp\hwpx-samples" "C:\temp\hwpx_feature_scan.md"
```
--------------------------------
### Set Page Numbering
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Inserts page numbers into an HWPX file using COM automation, with options for position and formatting.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe --visible page-number-set "" "C:\temp\page_numbered.hwpx" --draw-pos 5 --side-char "-" --report "C:\temp\page_numbered.md"
```
--------------------------------
### Set Header/Footer Apply Page Type
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Updates the 'applyPageType' for an existing header/footer reference in an HWPX file. This command focuses solely on updating the page type and does not create new elements or edit rich content.
```powershell
& $cli set-header-footer-apply-page-type C:\temp\template.hwpx C:\temp\header-footer-page-type.hwpx --kind footer --section section0 --id-ref footer-ref --apply-page-type BOTH --report C:\temp\header-footer-page-type.md
```
--------------------------------
### Replace a Specific Picture in HWPX File
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/image-replacement.md
Replace an existing image control within an HWPX file with a new image. This command preserves the original picture's layout properties. Target selectors include control index, picture index, or binary item ID reference.
```powershell
& $cli replace-image-control C:\temp\template.hwpx C:\temp\replaced.hwpx --target control:gso:0 --image C:\temp\new-image.png --report C:\temp\replace-image-report.md
```
--------------------------------
### Set Page Number
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Inserts page numbers into an HWPX file using COM support. Verification can be done using `scan-hwpx-features` and `validate-layout`.
```powershell
& $cli --visible page-number-set '' 'C:\temp\page_numbered.hwpx' --draw-pos 5 --side-char '-' --report 'C:\temp\page_numbered.md'
```
--------------------------------
### Probe Copying Content from Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Probes the process of copying content from a source HWPX document to a target HWPX document without making permanent changes. Generates a report detailing the probe results.
```powershell
& $cli --visible probe-copy-from-doc '' '' --source image:0 --target doc-end --report 'test\out\copy_probe.md'
```
--------------------------------
### Fill Markdown Table Cells in HWPX Template
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Fills specific cells in an HWPX template using data from a Markdown file. Requires careful use around merged or irregular tables.
```powershell
& $cli --visible fill-markdown-table '' '' 'test\out\table-out.hwpx' 8 3 1 0 1 2 5
```
--------------------------------
### Copy Content from Document
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/skills/openhwpsdk-windows-cli/SKILL.md
Copies content from a source HWPX document to a target HWPX document. Supports various source and target types, including images, paragraphs, and controls. Generates a report of the operation.
```powershell
& $cli --visible copy-from-doc '' '' 'test\out\copy_from_doc.hwpx' --source image:0 --target doc-end --report 'test\out\copy_from_doc.md'
```
--------------------------------
### Add Columns to HWPX Table
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/cli-reference.md
Adds a specified number of columns with given text content to an existing table in an HWPX file at a particular column index. A report is generated.
```powershell
& $cli table-column-package C:\temp\template.hwpx C:\temp\column-added.hwpx --table-index 4 --action add --column 1 --count 1 --text "HNEW;R1NEW;R2NEW" --report C:\temp\column-added-report.md
```
--------------------------------
### Extract Form Map from HWPX Template
Source: https://github.com/zarathucorp/openhwpsdk/blob/main/docs/markdown-hwpx-validation-workflow.md
Extracts the form map from a template HWPX file to an XML file. This XML maps the entire document package before exposing write targets.
```bat
src\OpenHwp.Automation.Cli\bin\Release\OpenHwp.Automation.Cli.exe extract-form-map "" "C:\temp\openhwpsdk-out\template_form_map.xml"
```