« Back to Using Liferay

Document Conversion with OpenOffice

Introduction #

Liferay has built-in support for converting document types using OpenOffice.org backend.

Installing and running #

To enable document conversion in the Document Library portlet, follow the instructions bellow:

1. Install OpenOffice.org v2.0.3 or higher (has been tested on many versions, include 3.2).

2. Go to the folder where it was installed (for example, C:\Program Files\OpenOffice.org\program) and start OpenOffice service with the following command:

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

Note : on Linux (Debian) platform the "-" prefix are deprecated and said to be replaced by "--"

Note: It may be advantageous to add this as a cron job to run at start up.

If you are running on Mac OS X, then you should run the following from the Terminal program (note that this is assuming you are running Open Office and it is installed in your /Applications directory):

/Applications/OpenOffice.org.app/Contents/MacOS/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless

3. Go to Admin portlet, then click on the Server tab, then OpenOffice tab. Click on enable, in case OpenOffice is listening to a different port change the it accordingly.

Enable OpenOffice in portal-ext.properties #

To enable OpenOffice-Integration via portal-ext.properties, simply copy the following line in your portal-ext.properties:

    openoffice.server.enabled=true

You should also add in this file :

    openoffice.server.host=//YourServerURL//

Places where this integration is used #

Document Library portlet

You should see this when you View a document in Document Library, click on the desired conversion.

Wiki and Wiki Display portlets

If you click on General Options, you should see the "Covert To" row:

Supported formats #

From (any of) To (any of)
Text Formats
OpenDocument Text (.odt)
OpenOffice.org 1.0 Text (.sxw)
Rich Text Format (.rtf)
Microsoft Word (.doc)
Microsoft Word 2007 (.docx) (Requires OpenOffice 3.0+)
WordPerfect (.wpd)
Plain Text (.txt)
HTML (.html)
Portable Document Format (.pdf)
OpenDocument Text (.odt)
OpenOffice.org 1.0 Text (.sxw)
Rich Text Format (.rtf)
Microsoft Word (.doc)
Plain Text (.txt)
Spreadsheet Formats
OpenDocument Spreadsheet (.ods)
OpenOffice.org 1.0 Spreadsheet (.sxc)
Microsoft Excel (.xls)
Microsoft Excel 2007 (.xlsx) (Requires OpenOffice 3.0+)
Comma-Separated Values (.csv)
Tab-Separated Values (.tsv)
Portable Document Format (.pdf)
OpenDocument Spreadsheet (.ods)
OpenOffice.org 1.0 Spreadsheet (.sxc)
Microsoft Excel (.xls)
Comma-Separated Values (.csv)
Tab-Separated Values (.tsv)
Presentation Formats
OpenDocument Presentation (.odp)
OpenOffice.org 1.0 Presentation (.sxi)
Microsoft PowerPoint (.ppt)
Microsoft PowerPoint 2007 (.pptx) (Requires OpenOffice 3.0+)
Portable Document Format (.pdf)
Macromedia Flash (.swf)
OpenDocument Presentation (.odp)
OpenOffice.org 1.0 Presentation (.sxi)
Microsoft PowerPoint (.ppt)

JODConverter - library used for this integration

Known Issues #

  • On OSX 10.6, if you upgraded your Java to 6 update 22, this breaks OpenOffice.org 3.2.1 and earlier because they cannot find Java. You can find the fix for OO on the OpenOffice wiki
3 Attachments
137469 Views
Average (1 Vote)
The average rating is 5.0 stars out of 5.
Comments
Threaded Replies Author Date
This is a great feature! thanks Along with... Anand Abhyankar July 6, 2009 10:35 PM
the steps are given for Windows and Mac, what... Anand Abhyankar July 6, 2009 10:36 PM
The same steps works on Linux. i copy and... Claudio Patricio Rifo August 11, 2009 1:10 PM
It's there any way to integrate this... Claudio Patricio Rifo August 11, 2009 1:14 PM
I tried this command on linux but I get... Anand Abhyankar November 6, 2009 4:12 AM
Can this be called from within a portlet? E.g... Thomas Kellerer November 20, 2009 12:57 AM
Hi, Im just wondering... the file i converted... Achmed Tyrannus Albab April 16, 2010 3:04 AM
There is a bug... Szymon Gołębiewski May 11, 2010 1:42 AM
On 6.0.4 there is to be a problem when... Jules OU August 1, 2010 11:40 PM
Hi, I have followed the above... Gavin Meyers December 22, 2010 12:59 AM
Hi, i was trying to convert doc file to... Rojalin Patri October 17, 2011 4:10 AM
integration is working...but is there a way to... Marina Ra July 17, 2012 1:52 AM
Great feature, certainly but, can the exporting... Pedro Bezunartea López March 31, 2014 5:46 PM
For "Text Formats" by default liferay provides... Raja Seth December 23, 2014 9:37 PM

This is a great feature! thanks
Along with this, can we upload any type of document say .doc and Liferay will convert it save it as .pdf ? so that, all documents in the library portlet will be .pdf only!
Also, can we do same thing with video files also? meaning, upload any format, and liferay will store it in .flv or .swf by converting the videos
Posted on 7/6/09 10:35 PM.
the steps are given for Windows and Mac, what about Linux?
Posted on 7/6/09 10:36 PM.
The same steps works on Linux.
i copy and pasted
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;"
And it works!!!
Posted on 8/11/09 1:10 PM in reply to Anand Abhyankar.
It's there any way to integrate this functionallity to forums.
Also, itś there any way to make the wiki functionallity works like the web display? (icons at the bottom givin to all users with acces the chance to get a pdf on the fly)
Posted on 8/11/09 1:14 PM in reply to Claudio Patricio Rifo.
I tried this command on linux but I get following message :-

javaldx: Could not find a Java Runtime Environment!

Any comments?
Posted on 11/6/09 4:12 AM in reply to Claudio Patricio Rifo.
Can this be called from within a portlet? E.g by passing the filename of an OOo document?
Posted on 11/20/09 12:57 AM.
Hi, Im just wondering... the file i converted kept being corrupted. I tried txt to odt doc and pdf. Odt and doc can be viewed if repaired but the pdf cant be viewed at all.

please help.

regards.
Posted on 4/16/10 3:04 AM.
There is a bug (http://issues.liferay.com/browse/LPS-8982) in 6.0.0 preview version. Upgrade your Liferay to 6.0.1 RC.
Posted on 5/11/10 1:42 AM in reply to Achmed Tyrannus Albab.
On 6.0.4 there is to be a problem when converting documents that contain a link to an image

http://issues.liferay.com/browse/LPS-11778

Nothing is shown in catalina.out, does anybody know hoe to make soffice maintain a log?
Posted on 8/1/10 11:40 PM.
Hi,
I have followed the above instructions. The conversion happens only for docx -> pdf. But not for docx -> rtf,txt,9all other formats.

I installed openoffice 3.2 in ubuntu server 10.4 LTS.
Are there any plugins I need to install for OpenOffice3.2.

Thanks for any help.

Gavi
Posted on 12/22/10 12:59 AM.
Hi,
i was trying to convert doc file to pdf.it's not atall responding.system shows loading symbol continuously.can anyone suggest me something on this.
Thanks for help..
Rojalin
Posted on 10/17/11 4:10 AM in reply to Gavin Meyers.
integration is working...but is there a way to implement it for other portlets (as mentioned already) such as knowledge base??
Posted on 7/17/12 1:52 AM in reply to Rojalin Patri.
Great feature, certainly but, can the exporting layouts be customised? To allow, for example, the PDF exports have a different header, or footer than the other types.
Posted on 3/31/14 5:46 PM.
For "Text Formats" by default liferay provides conversion to the below formats :-

Portable Document Format (.pdf)
OpenDocument Text (.odt)
OpenOffice.org 1.0 Text (.sxw)
Rich Text Format (.rtf)
Microsoft Word (.doc)
Plain Text (.txt)

Is there a possibility of converting Docx/Doc format to Web Content(which is xml format) or to html format.
Posted on 12/23/14 9:37 PM.