« 返回到 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 附件
162439 查看
平均 (3 票)
满分为 5,平均得分为 5.0。
评论
讨论主题回复 作者 日期
This is a great feature! thanks Along with... Anand Abhyankar 2009年7月6日 下午10:35
the steps are given for Windows and Mac, what... Anand Abhyankar 2009年7月6日 下午10:36
The same steps works on Linux. i copy and... Claudio Patricio Rifo 2009年8月11日 下午1:10
It's there any way to integrate this... Claudio Patricio Rifo 2009年8月11日 下午1:14
I tried this command on linux but I get... Anand Abhyankar 2009年11月6日 上午4:12
Can this be called from within a portlet? E.g... Thomas Kellerer 2009年11月20日 上午12:57
Hi, Im just wondering... the file i converted... Achmed Tyrannus Albab 2010年4月16日 上午3:04
There is a bug... Szymon Gołębiewski 2010年5月11日 上午1:42
On 6.0.4 there is to be a problem when... Jules OU 2010年8月1日 下午11:40
Hi, I have followed the above... Gavin Meyers 2010年12月22日 上午12:59
Hi, i was trying to convert doc file to... Rojalin Patri 2011年10月17日 上午4:10
integration is working...but is there a way to... Marina Ra 2012年7月17日 上午1:52
Great feature, certainly but, can the exporting... Pedro Bezunartea López 2014年3月31日 下午5:46
For "Text Formats" by default liferay provides... Raja Seth 2014年12月23日 下午9: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
在 09-7-6 下午10:35 发帖。
the steps are given for Windows and Mac, what about Linux?
在 09-7-6 下午10: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!!!
在 09-8-11 下午1:10 发帖以回复 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)
在 09-8-11 下午1:14 发帖以回复 Claudio Patricio Rifo
I tried this command on linux but I get following message :-

javaldx: Could not find a Java Runtime Environment!

Any comments?
在 09-11-6 上午4:12 发帖以回复 Claudio Patricio Rifo
Can this be called from within a portlet? E.g by passing the filename of an OOo document?
在 09-11-20 上午12: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.
在 10-4-16 上午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.
在 10-5-11 上午1:42 发帖以回复 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?
在 10-8-1 下午11: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
在 10-12-22 上午12: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
在 11-10-17 上午4:10 发帖以回复 Gavin Meyers
integration is working...but is there a way to implement it for other portlets (as mentioned already) such as knowledge base??
在 12-7-17 上午1:52 发帖以回复 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.
在 14-3-31 下午5: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.
在 14-12-23 下午9:37 发帖。