Linux command
unoconv 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Convert document to PDF
unoconv -f pdf [document.docx]
Convert to specific format
unoconv -f [odt] [document.docx]
Convert multiple files
unoconv -f pdf [*.docx]
Output to specific directory
unoconv -o [/output/dir] -f pdf [document.docx]
Start listener daemon
unoconv --listener &
List available output formats
unoconv --show
Convert with export options
unoconv -f pdf -e PageRange=[1-5] [document.docx]
Read from stdin, write to stdout
cat [doc.docx] | unoconv --stdin --stdout -f pdf > [output.pdf]
说明
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.
参数
- -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.
FAQ
What is the unoconv command used for?
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.
How do I run a basic unoconv example?
Run `unoconv -f pdf [document.docx]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --format _format_ do in unoconv?
Output format (default: pdf).