Skip to content

Drush commands

The commands are found by Drush without extra configuration. They are Symfony Console commands, so Drush 13.7 or later is required.

dth:version

drush dth:version

Prints the LibreOffice version found with the current settings. If LibreOffice is not found it prints "LibreOffice not detected" with the path of the settings page and exits with an error. Alias: doc-to-html:version.

Use it after an installation, see Installation.

dth:clean

drush dth:clean

Removes the conversion working folders untouched for six hours, the same as cron. Permanent files and files in use stay. Alias: doc-to-html:clean. Cron does the same on its own schedule, see How the data flows.

dth:convert

drush dth:convert /path/to/document.docx

Converts a local file and prints the HTML. Alias: doc-to-html:convert.

The path can be absolute, relative to the Drupal root, or relative to the directory your shell was in. Drush changes to the Drupal root before it runs, so the command tries the Drupal root first, then the directory of the shell. If no file is found it prints "File not found".

Since 2.1.0

In 2.0.x only the Drupal root is tried. See Versions.

The command copies the file into a working folder under temporary://, converts it with the module settings, prints final_html, and deletes its temporary files. On failure it prints the errors and exits with an error.

Redirect the output to a file:

drush dth:convert report.docx > report.html