Command-line Interface

The Command-line Interface is provided as an executable file. You can call it from a Windows batch file.

Word API can be executed from the Command-line interface by specifying a file to convert or reading a file from standard input.

The Command-line interface has been tried and tested in the following environments.

Executable File Name

The executable file names are as follows:

Windows AHOOXMLDocxManagerCmd.exe

Environment Variables have to be set in order to execute these files. These are automatically set by the installer. See Environment Variables .

Command

The command-line interface of Word API executes a command-line program by specifying a command of the below format.

AHOOXMLDocxManagerCmd Subcommand Parameters

Command examples

[Install directory]/samples/cmd contains sample commands for each Subcommand.

Subcommand

For Subcommand, specify the Word API feature to be executed on the command-line interface. The Subcommand corresponding to the feature is as follows:

Parameter Functions
SimpleDataMerge This is a simple type data-merge feature. Specify "Common parameters for data-merge" and "Parameters for simple type" for the subsequent parameter part.
CompoundDataMerge This is a compound type data-merge feature. Specify "Common parameters for data-merge" and "Parameters for compound type" for the subsequent parameter part.
NestedTableDataMerge This is a nested table type data-merge feature. Specify "Common parameters for data-merge" and "Parameters for nested table type" for the subsequent parameter part.
GetDataMergeFields This is a feature to get the field defined in the data-merge template. Specify "Parameters for getting field defined in the data-merge template" for the subsequent parameter part.
If this parameter is specified, data-merge will not be processed.
UnlinkedSubDocs This is a feature to unlink the sub documents. Specify "Parameters for unlinking sub documents" for the subsequent parameter part.
EmbedLinkedImage This is a feature to embed the linked images. Specify "Parameters for linked image embedding" for the subsequent parameter part.
CompareDocuments This is a feature to compare two documents. Specify "Parameters for document comparison" for the subsequent parameter part.
CreateComparativeTable This is a feature to create comparative table. Specify "Parameters for creating comparative table" for the subsequent parameter part.
ParseChangedRatio This is a feature to get the change percentage. Specify "Parameters for getting the change percentage" for the subsequent parameter part.
GetFormDatas This is a feature to get the "Label (item name)" - "Data". Specify "Parameters related to getting data" for the subsequent parameter part.
ExecuteInspectDocument
RemoveMetaInformations

Parameters

Command-line interface parameters are specified in the following format:

option argument
The format of option* is "--option name", and specify the corresponding value in the argument.
Some options have abbreviations.
* It is not an option that indicates mandatory/optional.

Insert a half-width space between the specified character and the value of the parameter. When specifying a path name that contains a space, the path name must be enclosed in double quotation marks. When enclosing the path in double quotation marks, if the end of the path is "\", use "\\".
If the same parameters or contradictory parameters are specified, an error will occur.
The path for each parameter can be an absolute path or a relative path of the current directory.

Each parameter is described below.

Common parameters for command-line interface

Parameter Functions
--help If this parameter is specified without specifying a Verb, a list of Verbs will be displayed.
If this parameter is specified after the Verb, a brief description of the Verb's parameter will be displayed. At this time, the target feature is not executed.
--version Displays the version and copyright of the command line interface. If this parameter is specified, the actual conversion process is not performed.

Common parameters for data-merge

Parameter Functions Default Required
--input_file_path Template-File
-i Template-File
Specifies the path of the template file for data-merge. yes
--merge_data_encoding Character-Encoding-Of-Merging-Data-File
-e Character-Encoding-Of-Merging-Data-File
Specifies the character encoding of the merging data file. The value must be one of the following numbers or strings:
  1. SJIS
  2. UTF8
yes
--input_image_directory Input-Image-Directory Specifies the path of the data-merge image. When performing a data-merge for a template that has an image data-merge field, an error will occur if no parameters are specified.
--executor Executor Specifies the executor of the data-merge. If no parameter is specified, the last updater is not changed from the last saver.
--cell_overflow_rule Cell-Overflow-Rule Specifies the control when cell data-merge overflows the cell width. The value must be one of the following numbers or strings:
  1. Normal
  2. FontSizeChange
  3. CutExcess
  4. Padding
0
--padding_string Fill-Character Specifies the fill character when specifying the Cell Overflow Rule as 3 (Padding). #
--output_file_path Output-File-Of-Execution-Results
-o Output-File-Of-Execution-Results
Specifies the output file path of execution results. yes
--file_add_column Column-Name-Of-Additional-Character-To-Outpu-File Specifies the column name corresponding to the additional data to the output file.
When multiple files are output, if no parameter is specified, a numerical value is added to the output file name from 1 in sequence.
--additional_filename_place Additional-Character-Position Specifies the position of the additional character to the output file. Specify one of the following for the additional position.
  1. Head
  2. Tail
0

Parameters for simple type

Parameter Functions Default Required
--csv CSV-Format-Merging-Data Specifies the path of the target file when the merging data is in CSV format.
Cannot be specified at the same time as --json.
yes
--json JSON-Format-Merging-Data Specifies the path of the target file when the merging data is in JSON format.
Cannot be specified at the same time as --csv.
yes
--simple_outputmode Simple-Type-Output-Mode Specifies the output mode of the multiple record merging data for the simple type data-merge. The value must be one of the following numbers or strings:
  1. Single
  2. PerData
0

Parameters for compound type

Parameter Functions Default Required
--csv CSV-Format-Main-Merging-Data Specifies the path of the target file when the main merging data for compound type is in CSV format.
When this option is specified, the --detail_csv must also be specified.
Cannot be specified at the same time as --json.
yes
--detail_csv CSV-Format-Sub-Merging-Data Specifies the path of the breakdown part file when the main merging data for compound type is in CSV format.
When this option is specified, the --csv must also be specified.
Multiple items can be specified for each breakdown data with separating by commas or single-byte spaces.
Cannot be specified at the same time as --json.
yes
--json JSON-Format-Merging-Data Specifies the path of the target file when the merging data is in JSON format.
Cannot be specified at the same time as –-csv and –-detail_csv.
yes
--compound_repeatingrows_pattern Compound-Type-Breakdown-Pattern Specifies the number of rows pattern for the breakdown of the compound type. The value must be one of the following numbers or strings:
  1. Fixed
  2. Variable
0
--compound_multiple_pages_style Compound-Type-Multiple-Page-Style Specifies the style for multi-page breakdown with a fixed number of rows in the compound type. The value must be one of the following numbers or strings:
  1. RepeatTemplate
  2. RepeatDetail
0
--compound_deleting_footerrule Compound-Type-Footer-Deletion-Rule Specifies the editing rule of the footer part with fixed number of rows for the compound type. The value must be one of the following numbers or strings:
  1. LeaveAll
  2. DeleteAll
  3. LeaveFld
0
--linking_key Column-Name-With-Unique-Value-In-The-Data Specifies the linking key in the compound type.
CSV format data: Common item names for main and sub data
JSON format data: Key of the first level object with unique value in the data
will be specified.
yes

Parameters for nested table type

Parameter Functions Default Required
--csv CSV-Format-Merging-Data Specifies the path of the target file when the merging data other than nested table is in CSV format.
Cannot be specified at the same time as --json.
yes
--json JSON-Format-Merging-Data Specifies the path of the target file when the merging data other than nested table is in JSON format.
Cannot be specified at the same time as --csv.
yes
--nested_json Nested-Table-Merging-Data Specifies the path of the nested table merging data.
yes
--detail_table_type Nested-Table-Width Specifies the width of the data-merge table for the nested table type. The value must be one of the following numbers or strings:
  1. FixedMinimum
  2. DividedPct
  3. DividedDxa
0

Parameters for getting field defined in the data-merge template

Parameter Functions Default Required
--input_file_path Template-File
-i Template-File
Specifies the path of the template file for data-merge. yes

Parameters for unlinking sub documents

Parameter Functions Default Required
--input_file_path Group-Doc-File
-i Group-Doc-File
Specifies the path of the master document file for group document. yes
--output_file_path Output-File
-o Output-File
Specifies the path of the output file of the execution result. yes
--duplicate_style Processing-When-style-Is-Duplicated Specifies the processing when the style name is the same in different style definitions in the master document and the sub document. The value must be one of the following numbers or strings:
  1. Ignore
  2. Maintain
0
--sub_docs_dir Sub-Document-Storage-Directory Specifies the path of the directory that contains the sub documents of the group document.
If no parameter is specified, the sub document is fetched from the directory of the master document file.

Parameters for linked image embedding

Parameter Functions Default Required
--input_file_path File-Path
-i File-Path
Specifies the path of the file that embeds the linked image. yes
--output_file_path Output-File
-o Output-File
Specifies the path of the output file of the execution result. yes

Parameters for document comparison

Parameter Functions Default Required
--original_file_path Original-Doc-File Specifies the path of the original document file to compare. yes
--revised_file_path Revised-Doc-File Specifies the path of the revised document file to compare. yes
--output_file_path Output-File
-o Output-File
Specify the path of the output file of the execution result. yes

Parameters for creating comparative table

Parameter Functions Default Required
--original_file_path Original-Doc-File Specify the path of the original document file of the comparative table. yes
--revised_file_path Revised-Doc-File Specifies the path of the revised document of the comparative table. yes
--output_file_path Output-File
-o Output-File
Specifies the path of the comparative table output file. yes

Parameters for getting the percentage of the change

Parameter Functions Default Required
--original_file_path Original-Doc-File Specifies the path of the original document file. yes
--revised_file_path Revised-Doc-File Specifies the path of the revised document file. yes

Parameters related to getting data

Parameter Functions Default Required
--template_file_path Template-Doc-File
-t Template-Doc-File
Specifies the path of the template file. yes
--submitted_file_path Submitted-File
-s Submitted-File
Specifies the path of the submitted file. yes

Parameter for inspect document

Parameter Functions Default Required
--input_file_path Input-File
-i Input-File
Specifies the path of the file to execute the inspect document. yes

Parameters for removing meta information

Parameter Functions Default Required
--input_file_path Input-File
-i Input-File
Specifies the path of the file to remove meta information. yes
--output_file_path Output-File-Of-Execution-Results
-o Output-File-Of-Execution-Results
Specifies the path of the output file of execution results. yes
--document_properties
-d
Specifies when removing a property information.
--personal_information
-p
Specifies when removing a personal information.
--hidden_text
-h
Specifies when removing a hidden text.

Return Value

When executing with a command line Interface, if successful, the program finishes the process with the return value of 0. If not successful, the program finishes the process with a return value of error code.
When the –help or –version is specified, the return value is 0.