`
刘逸君
  • 浏览: 37709 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Ubuntu 安装openoffice

阅读更多

文档地址:http://orangered3stones.iteye.com/blog/1496611
http://www.lampdeveloper.co.uk/linux/converting-doc-to-pdf-txt-or-html-using-php-and-linux.html
环境:
Ubuntu Server 11.04 64位,OpenJDK 6 OpenOffice 3

使用 jodconverter 需要用到OpenOffice的文档转换服务,实际部署时遇到中文转换乱码的问题,以下为详细的安装部署过程:

 

1) 运行如下命令安装OpenOffice及相关依赖的库:

$ sudo apt-get install xvfb -->11.5MB
$ sudo apt-get install openoffice.org -->
130MB
$ sudo apt-get install openoffice.org-java-common
$ sudo apt-get install language-pack-zh-*  -->
必须的中文字体包

$ sudo apt-get install language-selector language-selector-common  -->
35.4MB

2) 修改 /etc/environment (这个貌似不配置也行,我没试过)

修改 LANGUAGE="zh_CN:zh" LANGUAGE="zh_CN:zh:en_US:en",没有就添加进去。

保存退出执行如下两个命令:

$ source /etc/environment

$ fontconfig-voodoo -f zh_CN

 

3) 安装openjdk6和中文字体配置 (这个是解决中文乱码的关键)

$ sudo apt-get install openjdk-6-jdk -->安装openjdk6

$ sudo apt-get install ttf-wqy-microhei -->安装中文字体

然后运行如下命令修改Java字体配置:

$ sudo vi /usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties

修改为如下节点对应的值:

allfonts.umingcn=WenQuanYi Microhei Hei

allfonts.uminghk=WenQuanYi Microhei Hei

allfonts.umingtw=WenQuanYi Microhei Hei

allfonts.wqy-zenhei=WenQuanYi Microhei Hei

allfonts.shanheisun=WenQuanYi Microhei Hei

filename.WenQuanYi_Microhei_Hei=/usr/share/fonts/truetype/wqy/wqy-microhei.ttc

 

4) 启动 OpenOffice 文档转换服务 (记得后面有个符号&)

$ /usr/lib/libreoffice/program/soffice.bin -headless -nologo -norestore -nofirststartwizard -accept="socket,host=localhost,port=8100;urp" &

注:8100为端口号,可以按照实际需要更改。

 

其他注意事项:

如果使用jodconverter出现如下异常,只须将 jodconverter tomcat 服务和 OpenOffice 的文档转换服务使用同一个用户启动即可:

com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: conversion failed: could not save output document; OOo errorCode: 525
     com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadAndExport(OpenOfficeDocumentConverter.java:142)
     com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:120)
     com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
     com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:88)
     com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:82)
  ......

 安装
unoconv
apt-get install unoconv  openoffice.org-writer
启动:

/usr/lib/libreoffice/program/soffice.bin -nologo -nodefault -accept="socket,host=localhost,port=8100;urp" &

分享到:
评论

相关推荐

    openOffice安装包

    openOffice是一套跨平台的办公软件套件,可以在代码中实现附件预览功能的实现,将常用的word,excel,ppt文件转换成方便查看的pdf来实现在线预览功能

    ubuntu9.10上openoffice的汉化包

    ubuntu9.10上openoffice界面的汉化包,deb格式.

    OpenOffice 4.1.8 Ubuntu 安装包

    OpenOffice4.1.8 64位 Ubuntu 安装包 。Apache_OpenOffice_4.1.8_Linux_x86-64_install-deb_zh-CN.tar.gz

    ubuntu openoffice资源

    1.0.4 ubuntu10.0.4 系统安装

    Ubuntu_10.04_安装手记

    Ubuntu 的安装手记 很不错 本安装记录内容目录 说明 环境 常用命令与快捷键 文件系统中的系统文件夹说明 Ubuntu中的隐藏文件或文件夹方法 三种安装方法 apt-get/dpkg/sources pack Ubuntu 9.04 中 F1 帮助摘要 硬盘...

    OpenMeetings 5.0.0-M2在Ubuntu 18.04上的安装手册

    OpenMeetings最新版本5.0.0, 基于Kurento,FFMPEG,OpenOffice,ImageMagick,SWFTools,SOX等第三方开源服务器、工具、组件等。该手册指导你一步一步安装和配置这些服务器和工具,直到整个安装成功。亲测,该手册上的...

    UBUNTU桌面培训10.04 简体中文r1 PDF版

    1.4.1 安装 ................................................. 16 1.4.2 应用程序 ............................................. 17 1.5 本课小结 ..................................................... ...

    Beginning Ubuntu Linux Part1

    We investigate OpenOffice.org, the complete office suite built into Ubuntu. After an introduction to OpenOffice.org, separate chapters explore its word processor, spreadsheet, database, and ...

    Beginning Ubuntu Linux Part2

    We investigate OpenOffice.org, the complete office suite built into Ubuntu. After an introduction to OpenOffice.org, separate chapters explore its word processor, spreadsheet, database, and ...

    Ubuntu桌面版使用手册-部分3

    Ubuntu桌面版使用手册-部分1

    UBUNTU系统清理工具 BleachBit

    BleachBit 是一款专为 Linux 设计的系统清理工具。使用 BleachBit,你可以清理系统中的缓存、历史、...当前,BleachBit 能够清理 Beagle、Firefox、Opera、Epiphany、Flash、OpenOffice.org 等软件所产生的垃圾文件。

    McGraw-Hill.How.to.Do.Everything.Ubuntu.2009.pdf

    PART III Open the Door to OpenOffice 9 The Write Stuff ............ 111 10 Spread It Out with Calc .......... . 125 11 I’m Impressed ............ 139 12 All Your Base ............ . 149 13 Drawn to ...

    full circle(ubuntu杂志)

     《Full Circle》由 Scribus、 Gimp、OpenOffice.org 等软件创建,杂志包含的所有内容在知识共享许可协议即 CC-license (Creative Commons Attribution-By-Share Alike 3.0 Unported) 下发布,具体的协议信息请访问...

    Linux的英文原版书(Ubuntu)part1

    英文原版书,讲Linux(ubuntu)的,引文加起来刚超过20M,所以分开上传,分开算积分。 文件列表: [edubt]Accessing_Computers_Remotely.pdf [edubt]A_History_and_Politics_Lesson.pdf [edubt]Backing_Up_Data.pdf ...

    Linux的英文原版书(Ubuntu) part2

    Linux的英文原版书,Ubuntu的。 此为part2 [edubt]Accessing_Computers_Remotely.pdf [edubt]A_History_and_Politics_Lesson.pdf [edubt]Backing_Up_Data.pdf [edubt]Booting_Ubuntu_for_the_First_Time.pdf [edubt]...

    ubuntu_vsftpd FTP服务器配置学习札记

    共九个文档,其中详细介绍了,vsftpd的安装及配置,还有详细的注意事项。不过都是openoffice文档,在ubuntu才能打开哦

    (错发,发现不用分割,无法删除,请下载完整版)UBUNTU桌面培训10.04 简体中文PDF版(part1)

    1.4.1 安装 ................................................. 16 1.4.2 应用程序 ............................................. 17 1.5 本课小结 ..................................................... ...

    linux基础教程 ubuntu

    linux基础教程 ubuntu 第一课 了解 LINUX ...........................................................................................1 第二课 安装 Linux .....................................................

    python-uno_2.4.1-1ubuntu2.5_i386.deb on Intel x86 machines

    在Python-UNO桥允许使用标准的OpenOffice.org API的Python脚本语言。另外,它还允许别人开发在Python中的UNO组件,从而Python的UNO组件可能运行在OpenOffice.org的过程中,可以调用C + +或内置的StarBasic的脚本语言...

    sun-java6-jdk

    sun-java6-jdk的安装包。还有一些openoffice3.0在ubuntu上的安装文档说明。

Global site tag (gtag.js) - Google Analytics