« 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
68104 Views
Average (0 Votes)
Comments

Showing 13 Comments

Anand Abhyankar
7/6/09 10:35 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

Anand Abhyankar
7/6/09 10:36 PM

the steps are given for Windows and Mac, what about Linux?

Claudio Patricio Rifo
8/11/09 1:10 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!!!

Claudio Patricio Rifo
8/11/09 1:14 PM

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)

Anand Abhyankar
11/6/09 4:12 AM

I tried this command on linux but I get following message :-

javaldx: Could not find a Java Runtime Environment!

Any comments?

Thomas Kellerer
11/20/09 12:57 AM

Can this be called from within a portlet? E.g by passing the filename of an OOo document?

Achmed Tyrannus Albab
4/16/10 3:04 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.

Szymon Gołębiewski
5/11/10 1:42 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.

Jules OU
8/1/10 11:40 PM

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?

Gavin Meyers
12/22/10 12:59 AM

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

Rojalin Patri
10/17/11 4:10 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

starr Cancer
3/1/12 2:05 AM

Thank you for this documentary ... thank you, thank you. And thank you to the amazing Mr Glendinning.

Regards,
Buy Essay Online

iq6rb iq6rb
4/29/12 9:47 AM

</a><a href="http://www.iq6rb.com/"> اغاني عراقية </a></p>
</a><a href="http://www.iq6rb.com/vb/forumdisplay.php?f=123/"> ازياء 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43712/">ازياء محجبات 2012</a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=46454/"> ازياء صيفيه 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=45650/"> فساتين 2013 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43552/"> فساتين سهره 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=41024/"> احدث ازياء 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43488/"> فساتين اعراس 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43821/"> فساتين قصيره 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=45799/"> ازياء تركيه 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43201/"> ازياء بنات 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/showthread.php?t=43332/"> عبايات 2012 </a></p>
</a><a href="http://www.iq6rb.com/vb/forumdisplay.php?f=208/"> اغاني عراقية 2012 </a></p>