UNOCONV(1)
π
UNOCONV(1) β the unoconv glow-up β¨
ok so this is the manual page for unoconv, and honestly? she's iconic. converting docs from literally anything LibreOffice can open into literally anything LibreOffice can spit out. no cap. π¦
β¨ NAME β¨
unoconv β convert any document from and to any LibreOffice supported format π
πΈ SYNOPSIS πΈ
unoconv [options] file [file2 ..]
unoconv --listener [--server SRV] [--port PRT] [--connection CON]
π 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. it's giving "universal translator but make it office docs" fr fr π«
she uses LibreOffice's UNO bindings for non-interactive conversion of documents, which means she needs a LibreOffice instance to talk to. so if she can't find one, she'll just start her own instance for temporary usage β very main character, very self-sufficient π . and if you want, you can start a "listener" instance to use for subsequent connections, or even for remote connections. the way that just works ππ
π OPTIONS π
-c,--connectionβ the UNO connection string, used by the client to connect to a LibreOffice instance, or used by the listener to make LibreOffice listen. π«Ά Default connection string is"socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"-d,--doctypeβ specifies the LibreOffice document type of the backend format. the possible document types are:document,graphics,presentation,spreadsheet. π Default document type is'document'.-e,--exportβ sets specific export filter options (related to the LibreOffice filter you're using). for example, for the PDF output filter you can specify:-e PageRange=1-2. see the EXPORT FILTERS section, bestie π-f,--formatβ specifies the output format for the document. you can get a list of possible output formats per document type by using the--showoption. β Default document type is'pdf'.-F,--fieldβ add or replace a user-defined text field with a value. e.g.-F Client_Name="Oracle"β¨-i,--importβ sets specific import filter options (related to the LibreOffice import filter based on the input filename). see the IMPORT FILTERS section π-I,--input-filter-nameβ specifies the input filter name, used when the file ending doesn't match the file type. e.g.-I odtπ-l,--listenerβ startsunoconvas a listener forunoconvclients to connect to. π-M,--metaβ add or replace document metadata with a value. e.g.-M Author="Dag Wieers"π¦-n,--no-launchβ by default, if no listener is running,unoconvwill 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. πΈ--passwordβ provide a password to decrypt the document π--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). π Default port is'2002'.--preserveβ keep timestamp and permissions of the original document π«-s,--serverβ server (address) to listen on (as listener) or to connect to (as client). π Default server is'localhost'.--showβ list the possible output formats to be used with-f. π--stdinβ read input file from stdin (filenames are ignored if provided) π₯--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β whenunoconvstarts 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, and each of them gets converted to the specified output format. that's it, that's the argument. periodt π
π§ 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, which β depending on the filter used β accepts different arguments. π¦
ngl it's not always clear what import filter options you can provide, but the import dialog in LibreOffice for the filter you are using might give a good indication as to what you can expect as import filter options. π
the reference is LibreOffice's documentation, and for spreadsheets it is described at: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options but we will look into some examples. π
β DEFAULT IMPORT FILTER OPTIONS β
the default import filter for many imports (e.g. Lotus, dBase or DIF) accepts the input encoding-type as the only argument, so if you require utf-8 (76) you can do:
-i FilterOptions=76
for a list of possible encoding types, you can use the above link to find the possible options. π
FilterOptions
π TEXT IMPORT FILTER OPTIONS π
the Text import filter accepts a FilterOptions setting holding the input encoding. β¨
FilterOptions
π CSV IMPORT FILTER OPTIONS π
the CSV import filter accepts a FilterOptions setting, and the order is: separator(s),text-delimiter,encoding,first-row,column-format πΈ
for example you might want to use this for a real comma-separated document:
-i FilterOptions=44,34,76,2,1/5/2/1/3/1/4/1
which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF-8 (76) for the input encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date). ποΈ
if you like to use more than one separator (say a space or a tab) and use the system's encoding (9), but with no text-delimiter, you can do:
-i FilterOptions=9/32,,9,2
for a list of possible encoding types, you can use the above link to find the possible options. π
FilterOptions
π₯ 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's possible β each of those widgets represents an option. ππ
π TEXT EXPORT FILTER OPTIONS π
the Text export filter accepts a FilterOptions setting holding the output encoding.
FilterOptions
the order of the arguments is: encoding,field-seperator,text-delimiter,quote-all-text-cells,save-cell-content-as-shown β¨
π«Ά CSV EXPORT FILTER OPTIONS π«Ά
the CSV export filter accepts various arguments, and the order is: field-seperator(s),text-delimiter,encoding π¦
for example you might want to use this for a real comma-separated document:
-e FilterOptions=44,34,76
which will use a comma (44) as the field separator, a double quote (34) as the text delimiter, UTF-8 (76) for the export encoding, start from the second row and use the specified formats for each column (1 means standard, 5 means YY/MM/DD date). ποΈ
if you like to use more than one separator (say a space or a tab) and use the system's encoding (9), but with no text-delimiter, you can do:
-e FilterOptions=9/32,,9
for a list of possible encoding types, you can use the above link to find the possible options. π
FilterOptions
π 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:
http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export
for example one can specify: -e PageRange=1-2 β¨
here is a list of all options β however, for more details please look in filters.txt: π
AllowDuplicateFieldNamesCenterWindowChangesConvertOOoTargetToPDFTargetDisplayPDFDocumentTitleDocumentOpenPasswordEmbedStandardFontsEnableCopyingOfContentEnableTextAccessForAccessibilityToolsEncryptFileExportBookmarksExportBookmarksToPDFDestinationExportFormFieldsExportLinksRelativeFsysExportNotesExportNotesPagesFirstPageOnLeftFormsTypeHideViewerMenubarHideViewerToolbarHideViewerWindowControlsInitialPageInitialViewIsAddStreamIsSkipEmptyPagesMagnificationMaxImageResolutionOpenBookmarkLevelsOpenInFullScreenModePageLayoutPageRangePDFViewSelectionPermissionPasswordPrintingQualityReduceImageResolutionResizeWindowToInitialPageRestrictPermissionPasswordSelectionSelectPdfVersionUseLosslessCompressionUseTaggedPDFUseTransitionEffectsWatermarkZoom
π GRAPHICS EXPORT FILTER OPTIONS π
HeightResolutionWidth
π BMP EXPORT FILTER OPTIONS π
CompressionRLEEncoding
π¦ JPEG EXPORT FILTER OPTIONS π¦
ColorDepthQuality
π PBM/PGM/PPM EXPORT FILTER OPTIONS π
Encoding
β¨ PNG EXPORT FILTER OPTIONS β¨
CompressionInterlacedMode
π GIF EXPORT FILTER OPTIONS π
InterlacedModeTransparency
π§ EPS EXPORT FILTER OPTIONS π§
ColorFormatCompressionPreviewVersion
π EXAMPLES π
you can use unoconv in standalone mode β that means that in absence of a LibreOffice listener, it will start its own: π«
unoconv -f pdf some-document.odt
one can use unoconv as a listener (by default localhost:2002) to let other unoconv instances connect to it: π«Ά
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 %-
this also works on a remote host: π
unoconv --listener --server 1.2.3.4 --port 4567
and then connect another system to convert documents: π₯
unoconv --server 1.2.3.4 --port 4567
πΈ ENVIRONMENT VARIABLES πΈ
UNO_PATHβ tellsunoconvwhich LibreOffice pyuno installation it's supposed to be vibing with. like, which one. be specific bestie. example:/opt/libreoffice3.4/basis-link/programπ
β¨ EXIT STATUS β¨
okay so here's the tea π« β normally the exit status is 0 if the conversion ran successful. slay. but if an error has occured, the return code is most likely an error returned by LibreOffice (or its interface, called UNO), however β and this is the annoying part π β the error never translates to something meaningful. it's giving cryptic. it's giving "figure it out yourself."
in case you like to decipher the LibreOffice errCode (main character energy honestly π), 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
using the above lists, the error code 2074 means:
Class: 1 (ERRCODE_CLASS_ABORT)
Code: 26 (ERRCODE_IO_INVALIDPARAMETER or SVSTREAM_INVALID_PARAMETER)
and the error code 3088 means:
Class: 3 (ERRCODE_CLASS_NOTEXISTS)
Code: 16 (ERRCODE_IO_CANTWRITE)
so yeah. now you too can decode the vibes π
π¦ SEE ALSO π¦
convert(1), file(1), odt2txt
π BUGS π
unoconv uses the UNO bindings to connect to LibreOffice, and β plot twist β in absence of a usable socket, it will start its own LibreOffice instance with the correct parameters. it just does that. it's independent like that β¨
Note Please see the TODO file for known bugs and future plans. the lore is documented π
π REFERENCES π
unoconv is very useful together with the following tools:
- Asciidoc β
http://www.methods.co.nz/asciidoc/ - asciidoc-odf β
http://github.com/dagwieers/asciidoc-odf - docbook2odf β
http://open.comsultia.com/docbook2odf/
a list of possible import and export formats is available from:
- OpenOffice 2.1 β
http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_2_1 - OpenOffice 3.0 β
http://wiki.services.openoffice.org/wiki/Framework/Article/Filter/FilterList_OOo_3_0
π AUTHOR π
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). iconic licensing behavior tbh π«Ά
π AUTHOR π
- Dag Wieers
<dag@wieers.com>β Author.
π NOTES π
dag@wieers.comβmailto:dag@wieers.com
and that's a wrap bestie π this was unoconv version 0.4, dated 20 october 2010, page UNOCONV(1) β go forth and convert literally everything β¨π
πΈ
π¦ where this page comes from
- nixos 26.05: unoconv 0.9.0
- nixpkgs unstable: unoconv 0.9.0
- opensuse-leap 16.0: unoconv 0.9.0-bp160.1.9 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms