Tuesday, January 29, 2013
8:10 AM

Unoconv: Make The Automated Document Conversion Easier!

Unoconv is a command line based application which makes document conversion especially automated document conversion easier. We can convert one even a hundred documents into another format in a single command. Unoconv converts between any document formats which LibreOffice supports or understands. It uses LibreOffice UNO bindings for on interactive conversion of documents. Unoconv needs to start an instance of LibreOffice or use an instance of LibreOffice you might have already running (if any) to do the conversion processes. Supported document formats such as: Open Document Format (.odt), MS Word (.doc), MS Office Open/MS OOXML (.xml), Portable Document Format (.pdf), HTML, XHTML, RTF, Docbook (.xml), and more. You can get list of complete supported formats by running "unoconv --show" (without quotes) on the Terminal.


Unoconv features:
  • Converts between different document formats that LibreOffice understands
  • LibreOffice can export to about 100 different document formats
  • Can be used for batch processing
  • Combines with asciidoc and docbook2odf/xhtml2odt to create PDF or Word (.doc) files
  • Can apply custom style templates during conversion (to enforce corporate identity)
  • Autostarts LibreOffice for processing if necessary
  • Can be used in a client/server environment to process documents centrally
  • Can influence LibreOffice filters during import and export

Install Unoconv on Ubuntu
Unoconv is available in Ubuntu repository, so installing it is easy. Simply run the following command:
  • sudo apt-get install unoconv
Basic Usage Instruction
Before you dive into the command itself, I want to give a little explanation about one or more command flags:
  • The "-f" flag is used to indicate the final output of the conversion. For example "-f pdf" will convert documents into PDF.
  • The "-o" flag is used if you want to specify the different location of the converted documents.

Here's the example to convert all Microsoft Office documents in working directory into PDF and save the converted document in "converted_pdf" folder under the current directory.
  • unoconv -f pdf -o converted_pdf *.doc
The above command will convert all documents in the working directory. So if there are hundreds documents inside the directory, they will be converted with just a single command. Of course, you can also convert other type of documents, please run "unoconv --help" or "man unoconv" the dive deeper.

Regards :)

0 comments:

Post a Comment