Available options

List of arguments available when running dynadocx.


Arguments

A set of options are available to work with the documents:

Option Content Default Description
--action
-a
string default

Optional.

Supported values:

  • default: default value, used to work with documents.
  • get_styles: returns a JSON with the existing styles in a DOCX.
  • get_variables: returns a JSON with the existing placeholders (variables) in a DOCX.
  • transform: converts DOCX to PDF and other document formats.

Only a single action can be used.

--data
-d
file or URL (JSON)

Optional.

Setting and design properties, and template contents. Allows adding multiple values.

--input
-i
file or URL (HTML and CSS)

Optional.

Contents and styles to be added. Allows adding multiple values.

--license
-l
string

Required.

Only available in purchased licenses.

--output
-o
string output.docx

Optional.

File output.

--template
-t
file or URL (DOCX) internal template

Optional.

Template to be used.

-v error level

Optional.

Level of verbosity.

--version
-V
Optional. Version information.
--help
-h
Optional. Show help information.

This is the full help information of the dynadocx command:


USAGE:
    dynadocx [FLAGS] [OPTIONS] --license <license>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v               Level of verbosity

OPTIONS:
    -a, --action <action>          Action. [possible values: default, get_styles, get_variables, transform]
    -d, --data <data>...           JSON data.
    -i, --input <input>...         Input HTML and CSS.
    -l, --license <license>        License key.
    -o, --output <output>          Output file.
    -t, --template <template>      Template file.

Samples

license key

Purchased licenses must always set the license key available on the user dashboard page:

dynadocx ... -l LICENSE_KEY

The trial package doesn't include this option.

action

Generate a DOCX from a file with HTML contents and CSS styles (default action, no value is needed):

dynadocx -i content.html

Get existing styles in a DOCX:

dynadocx -a get_styles -t document.docx

Get existing placeholders in a DOCX:

dynadocx -a get_variables -t document.docx

Transform a DOCX to PDF:

dynadocx -a transform -i document.docx -o document.pdf

data

Generate a DOCX from a JSON file with custom settings and properties:

dynadocx -d data.json

Generate a DOCX from two JSON files with custom settings and properties:

dynadocx -d data1.json data2.json

Generate a DOCX from a JSON URL with custom settings and properties:

dynadocx -d https://www.domain.com/data.json

input

Generate a DOCX from a file with HTML contents and CSS styles:

dynadocx -i content.html

Generate a DOCX from two files with HTML contents and CSS styles and save it using a custom filename:

dynadocx -i content1.html content2.html -o new_document.docx

Generate a DOCX from a URL with HTML contents and CSS styles:

dynadocx -i http://www.domain.com/content.html

Generate a DOCX from a file with HTML contents and CSS styles and a JSON file with custom settings and properties:

dynadocx -i content.html -d data.json

output

Generate and save a DOCX using the default filename (output.docx):

dynadocx -i content.html

Generate and save a DOCX using a custom filename:

dynadocx -i content.html -o new_document.docx

Generate and save a DOCX using a custom filepath:

dynadocx -i content.html -o ../folder/new_document.docx

template

Generate a DOCX using a template from the filesystem:

dynadocx -d data.json -t document.docx

Generate a DOCX using a template from a URL:

dynadocx -d data.json -t  http://www.domain.com/document.docx
Icon