1. 程式人生 > >centos下ppt(pptx)檔案轉換為pdf檔案,用PHP顯示內容

centos下ppt(pptx)檔案轉換為pdf檔案,用PHP顯示內容

1、搭建jdk環境,這裡不詳細介紹。

2、安裝OpenOffice

   OpenOffice下載地址http://softlayer-dal.dl.sourceforge.net/project/openofficeorg.mirror/4.0.0/binaries/zh-CN/Apache_OpenOffice_4.0.0_Linux_x86-64_install-rpm_zh-CN.tar.gz
   解壓下載包:tar xzvf Apache_OpenOffice_4.0.0_Linux_x86-64_install-rpm_zh-CN.tar.gz
   解壓後的目錄為zh-CN,進入RPMS目錄: cd  zh-CN/RPMS
   rpm安裝: rpm  -ivh *.rpm

3、複製windows字型

OpenOffice的預設安裝目錄為/opt/openoffice4/
把win7系統下面的C:\Windows\Fonts裡面的所有字型複製到/opt/openoffice4/share/fonts/truetype目錄下
    
4、在/opt/openoffice4/新建一個檔案,檔名sofficed
#! /bin/bash
/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
增加執行許可權: chmod 755 sofficed
設定開機啟動:vim  /etc/rc.local