« Torna a 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 Allegati
177473 Visualizzazioni
Media (3 Voti)
La media del punteggio è 5.0 stelle su 5.
Commenti
Commenti Autore Data
This is a great feature! thanks Along with... Anand Abhyankar 6 luglio 2009 22.35
the steps are given for Windows and Mac, what... Anand Abhyankar 6 luglio 2009 22.36
The same steps works on Linux. i copy and... Claudio Patricio Rifo 11 agosto 2009 13.10
It's there any way to integrate this... Claudio Patricio Rifo 11 agosto 2009 13.14
I tried this command on linux but I get... Anand Abhyankar 6 novembre 2009 4.12
Can this be called from within a portlet? E.g... Thomas Kellerer 20 novembre 2009 0.57
Hi, Im just wondering... the file i converted... Achmed Tyrannus Albab 16 aprile 2010 3.04
There is a bug... Szymon Gołębiewski 11 maggio 2010 1.42
On 6.0.4 there is to be a problem when... Jules OU 1 agosto 2010 23.40
Hi, I have followed the above... Gavin Meyers 22 dicembre 2010 0.59
Hi, i was trying to convert doc file to... Rojalin Patri 17 ottobre 2011 4.10
integration is working...but is there a way to... Marina Ra 17 luglio 2012 1.52
Great feature, certainly but, can the exporting... Pedro Bezunartea López 31 marzo 2014 17.46
For "Text Formats" by default liferay provides... Raja Seth 23 dicembre 2014 21.37

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
Inviato il 06/07/09 22.35.
the steps are given for Windows and Mac, what about Linux?
Inviato il 06/07/09 22.36.
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!!!
Inviato il 11/08/09 13.10 in risposta a 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)
Inviato il 11/08/09 13.14 in risposta a Claudio Patricio Rifo.
I tried this command on linux but I get following message :-

javaldx: Could not find a Java Runtime Environment!

Any comments?
Inviato il 06/11/09 4.12 in risposta a Claudio Patricio Rifo.
Can this be called from within a portlet? E.g by passing the filename of an OOo document?
Inviato il 20/11/09 0.57.
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.
Inviato il 16/04/10 3.04.
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.
Inviato il 11/05/10 1.42 in risposta a 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?
Inviato il 01/08/10 23.40.
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
Inviato il 22/12/10 0.59.
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
Inviato il 17/10/11 4.10 in risposta a Gavin Meyers.
integration is working...but is there a way to implement it for other portlets (as mentioned already) such as knowledge base??
Inviato il 17/07/12 1.52 in risposta a 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.
Inviato il 31/03/14 17.46.
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.
Inviato il 23/12/14 21.37.