开发环境linux centos6.3 lnmp php是用的帝国二次开发
队列机制暂未安装
yum install dos2unix yum install java
openoffice安装步骤
下载:
wget http://nchc.dl.sourceforge.net/project/openofficeorg.mirror/localized/zh-CN/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz
安装 tar zxf Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz ls cd zh-CN/ ls cd RPMS/ ls rpm -ivh *.rpm
以后台服务方式启动openoffice
cd /opt/openoffice.org3/program/
./soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &
启动的时候如果出现:javaldx:Cloud not find a Java Runtime Envirorment
那么运行下:yum install java
安装完没有错误之后,在进行后台服务方式启动。
查看端口:
[root@localhost program]# lsof -i tcp:8100 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME soffice.b 2617 root 15u IPv4 35393 0t0 TCP localhost:xprint-server (LISTEN)
[root@localhost program]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2023/php-cgi tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2089/nginx tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1881/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1957/master tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN 2617/soffice.bin tcp 0 0 :::22 :::* LISTEN 1881/sshd tcp 0 0 ::1:25 :::* LISTEN 1957/master
安装unoconv
安装openoffice下unoconv所需插件
yum install openoffice.org-pyuno*
下载并安装unoconv:
wget http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/unoconv-0.5-1.el6.rf.noarch.rpm mount /dev/cdrom /mnt/
rpm -ivh unoconv-0.5-1.el6.rf.noarch.rpm --nodeps
查询安装情况: rpm -qa|grep unoconv
使用示例: unoconv -f pdf aa.doc
遇到转化后中文出现空白问题:安装中文字体
nginx安装swftools步骤
wget http://www.swftools.org/swftools-0.9.1.tar.gz
安装 yum install gcc* automake* zlib-devel libjpeg-devel giflib-devel freetype-devel
tar -zvxf swftools-0.9.1.tar.gz cd swftools-0.9.1 ./configure make make install
安装之后pdf2swf -V来测试是否安装成功。
使用方法:
pdf2swf 1.pdf a.swf
参数1是待转格式的文件,参数2是转换后的格式。
flexpaper的安装及使用
下载安装 flexpaper wget http://flexpaper.googlecode.com/files/FlexPaper_1.4.5_flash.zip ls unzip FlexPaper_1.4.5_flash.zip
参照文件夹中的index.html来使用
上面的步骤安装完整之后,就轻松多了,虽然我做了2天,但是我觉得,尽力了,成长!
我用的是帝国6.6版本,需改动的文件是
/e/admin/ecmseditor/file.php 315行
<tr bgcolor="#FFFFFF"> <td>百度文库</td> <td> <input name="getbaiduwenku" type="checkbox" id="getbaiduwenku" value="1"> 是否生成swf文件 </td> </tr>
/e/admin/ecmseditor/editorfun.php 397行
if($post['getbaiduwenku']) { $docpath = $r[savepath].$r[insertfile].$r[filetype]; $pdfpath = $r[savepath].$r[insertfile].'.pdf'; $swfpath = $r[savepath].$r[insertfile].'.swf'; $pdf = exec("unoconv -f pdf ".$docpath."",$out,$status); if($status == 0) { $swf = exec("/usr/local/bin/pdf2swf ".$pdfpath." ".$swfpath."",$out,$status); if($status == 0) { $rmpdf = exec("rm -rf ".$pdfpath,$out,$status); if($status == 0) { $sql=$empire->query("insert into {$dbtbpre}enewsfile(filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,fpath) values('".$r[insertfile].".swf',$r[filesize],'$username','$r[filepath]','$filetime',$classid,'$no',$type,$post[filepass],$post[filepass],'$public_r[fpath]');"); } else { printerror2("删除失败",''); } } else { printerror2("swf生成失败",''); } } else { printerror2("pdf生成失败",''); } }
|