Hii guys, today we will share some tips for you, i'm sure that some day you would need it . This tips is about how to convert document format (that supported by LibreOffice) to pdf, doc. docx, xls, xlsx, odt, ods collectively.
There are many ways to convert a document, one that is commonly use is an online converter, through this tips not only resolve your problem but also you can helping others people to convert their documents via your server (you can build such us web converter portal).
Prepare the Application
To do this job some aplication that need to install are unoconv, LibreOffice, and Ubuntu 11.04 or more, why you need an Ubuntu 11.04 or more because the previous version (of Libreoffice/OpenOffice) is not support for docx and xlsx document.
Install the latest LibreOffice and it's library
On most Ubuntu version LibreOffice is defaulty installed, just upgrade it to the latest version.
- apt-get install libreoffice
unoconv is a command line utility that can convert any document format (doc, docx. odt, ods, xls, xlsx) that LibreOffice can import, to any file format (xml, pdf, doc, docx. odt, ods, xls, xlsx) that LibreOffice is capable of exporting.
- apt-get install unoconv
Batch Convert Document to csv, pdf, jpg, docx, xlsx, odt, or ods
- unoconv [options] to-file from-file
- unoconv -f pdf some-document.xls
- unoconv -f jpg some-document.png
- unoconv -f pdf *.docx
- unoconv -f ods *.xlsx
- unoconv -f xlsx *.csv
- unoconv -f ods *.csv
You can change the option, source, and destination format according to your needs. Some document format which supported by the this application are pdf, odf, odt, ods, xls, xlsx, doc, docx, rtf, ppt, pptx, csv, png, jpg, bmp and svg.