other versions
- wheezy 0.5-1
- jessie 0.6-6
- jessie-backports 0.7-1.1~bpo8+1
- testing 0.7-1.1
- unstable 0.7-1.1
UNOCONV(1) | UNOCONV(1) |
NAME¶
unoconv - convert any document from and to any LibreOffice supported formatSYNOPSIS¶
unoconv [options] file [file2 ..]DESCRIPTION¶
unoconv is a command line utility that can convert any file format that LibreOffice can import, to any file format that LibreOffice is capable of exporting.OPTIONS¶
-c, --connectionUNO connection string to be used by the client
to connect to an LibreOffice instance, or used by the listener to make
LibreOffice listen.
-d, --doctype
Default connection string is "socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
Specify the LibreOffice document type of the
backend format. Possible document types are: document, graphics,
presentation, spreadsheet.
-e, --export
Default document type is ´document´.
Set specific export filter options (related to
the used LibreOffice filter).
-f, --format
eg. for the PDF output filter one can specify: -e PageRange=1-2
See the *EXPORT FILTERS* section.
Specify the output format for the document.
You can get a list of possible output formats per document type by using the
--show option.
-i, --import
Default document type is ´pdf´.
Set specific import filters options (related
to the used LibreOffice import filter based on the input filename).
-l, --listener
See the *IMPORT FILTERS* section.
Start unoconv as listener for unoconv clients
to connect to.
-n, --no-launch
By default if no listener is running, unoconv
will launch its own (temporary) listener to make sure the conversion works.
This option will abort the conversion if no listener is found, rather than
starting our own listener.
-o, --output
If the argument is a directory, put the
converted documents in this directory. If multiple input files are provided,
use it as a basename (and add output extension). Otherwise use it as the
output filename.
--pipe
Use a pipe as an alternative connection
mechanism to talk to LibreOffice.
-p, --port
Port to listen on (as listener) or to connect
to (as client).
-s, --server
Default port is ´2002´.
Server (address) to listen on (as listener) or
to connect to (as client).
--show
Default server is ´localhost´.
List the possible output formats to be used
with -f.
--stdout
Print converted output file to stdout.
-t, --template
Specify the template to use for importing
styles from. This can be very useful if you have a corporate identity you have
to apply to every document you distribute.
-T, --timeout
When unoconv starts its own listener, try to
connect to it for an amount of seconds before giving up. Increasing this may
help when you receive random errors caused by the listener not being ready to
accept conversion jobs.
-v, --verbose
Be more and more and more verbose.
ARGUMENTS¶
You can provide one or more files as arguments to convert each of them to the specified output format.IMPORT FILTERS¶
Depending on the used input file, a different LibreOffice import filter is automatically used by unoconv. This import filter can be influenced by the -i option that, depending on the filter used, accepts different arguments.DEFAULT IMPORT FILTER OPTIONS¶
The default import filter for many imports (eg. Lotus, dBase or DIF) accepts as the only argument the input encoding-type, so if you require utf-8 you can do:-i utf-8
CSV IMPORT FILTER OPTIONS¶
The CSV import filter accepts various arguments, the order is: separator(s),text-delimiter,encoding,first-row,column-format-i 44,34,utf-8,2,1/5/2/1/3/1/4/1
-i 9/32,,system,2
EXPORT FILTERS¶
In contrast to import filters, export filters can have multiple named options, although it is not always clear what options are available. It all depends on the version of LibreOffice. The export dialog you get in LibreOffice might give you a clue about what is possible, each of those widgets represents an option.PDF EXPORT FILTER OPTIONS¶
The PDF export filter is likely the most advanced export filter in its kind with a myriad of options one can use. The export filter options are described in a separate document, or on LibreOffice’s wiki at:EXAMPLES¶
You can use unoconv in standalone mode, this means that in absence of an LibreOffice listener, it will starts its own:unoconv -f pdf some-document.odt
unoconv --listener & unoconv -f pdf some-document.odt unoconv -f doc other-document.odt unoconv -f jpg some-image.png unoconv -f xsl some-spreadsheet.csv kill -15 %-
unoconv --listener --server 1.2.3.4 --port 4567
unoconv --server 1.2.3.4 --port 4567
ENVIRONMENT VARIABLES¶
UNO_PATHspecifies what LibreOffice pyuno installation
unoconv needs to use eg. /opt/libreoffice3.4/basis-link/program
EXIT STATUS¶
Normally, the exit status is 0 if the conversion ran successful. If an error has occured, the return code is most likely an error returned by LibreOffice (or its interface, called UNO) however, the error never translates to something meaningful. In case you like to decipher the LibreOffice errCode, look at:http://cgit.freedesktop.org/libreoffice/core/tree/tools/inc/tools/errcode.hxx http://cgit.freedesktop.org/libreoffice/core/tree/svtools/inc/svtools/sfxecode.hxx http://cgit.freedesktop.org/libreoffice/core/tree/svtools/inc/svtools/soerr.hxx
Class: 1 (ERRCODE_CLASS_ABORT) Code: 26 (ERRCODE_IO_INVALIDPARAMETER or SVSTREAM_INVALID_PARAMETER)
Class: 3 (ERRCODE_CLASS_NOTEXISTS) Code: 16 (ERRCODE_IO_CANTWRITE)
SEE ALSO¶
convert(1), file(1), odt2txt
BUGS¶
unoconv uses the UNO bindings to connect to LibreOffice, in absence of a usable socket, it will start its own LibreOffice instance with the correct parameters.REFERENCES¶
unoconv is very useful together with the following tools: Asciidoc asciidoc-odf docbook2odfAUTHOR¶
Written by Dag Wieers, < dag@wieers.com[1]>RESOURCES¶
Main web site: http://dag.wieers.com/home-made/unoconv/COPYING¶
Copyright (C) 2007 Dag Wieers. Free use of this software is granted under the terms of the GNU General Public License (GPL).AUTHOR¶
Dag Wieers <dag@wieers.com>Author.
NOTES¶
- 1.
- dag@wieers.com
mailto:dag@wieers.com
20 october 2010 | 0.4 |