LinuxCommandLibrary

unoconv

Convert documents between formats via LibreOffice

TLDR

Convert document to PDF

$ unoconv -f pdf [document.docx]
copy
Convert to specific format
$ unoconv -f [odt] [document.docx]
copy
Convert multiple files
$ unoconv -f pdf [*.docx]
copy
Output to specific directory
$ unoconv -o [/output/dir] -f pdf [document.docx]
copy
Start listener daemon
$ unoconv --listener &
copy
List available output formats
$ unoconv --show
copy
Convert with export options
$ unoconv -f pdf -e PageRange=[1-5] [document.docx]
copy
Read from stdin, write to stdout
$ cat [doc.docx] | unoconv --stdin --stdout -f pdf > [output.pdf]
copy

SYNOPSIS

unoconv [options] file...
unoconv --listener [options]

DESCRIPTION

unoconv is a command-line document converter using LibreOffice/OpenOffice. It can convert between any formats supported by LibreOffice, including DOC, DOCX, ODT, PDF, HTML, TXT, and many more.
The tool communicates with a LibreOffice instance via UNO bindings. If no listener is running, unoconv starts a temporary instance automatically. For batch processing, start a persistent listener with --listener.
Export options allow fine-tuning of output, such as page ranges for PDF or image quality settings. Templates can apply consistent styling across conversions.
Note: unoconv is deprecated in favor of unoserver for new implementations.

PARAMETERS

-f, --format format

Output format (default: pdf).
-o, --output path
Output directory or filename.
-e, --export option
Export filter options (e.g., PageRange=1-5).
-i, --import option
Import filter options.
-t, --template file
Template for importing styles.
-l, --listener
Start as listener daemon.
-p, --port port
Port for listener (default: 2002).
--server address
Server address for listener.
-n, --no-launch
Don't start own listener if none found.
--stdin
Read input from stdin.
--stdout
Write output to stdout.
--show
List available output formats.
-T, --timeout seconds
Connection timeout.
-v, --verbose
Verbose output.

CAVEATS

Requires LibreOffice installation. First conversion may be slow while LibreOffice starts. Some format combinations may have limited fidelity. Consider unoserver for new projects.

HISTORY

unoconv was created by Dag Wieers to provide command-line access to LibreOffice's conversion capabilities. It became widely used for automated document processing. The project is now in maintenance mode with unoserver as its successor.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community