久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php office如何轉(zhuǎn) pdf

      php office轉(zhuǎn)pdf的方法:首先配置“php.ini”,并重啟環(huán)境;然后配置office組件服務(wù);接著在控制臺根節(jié)點下,找到【wps……】,右鍵設(shè)置屬性;最后編寫程序?qū)崿F(xiàn)轉(zhuǎn)換即可。

      php office如何轉(zhuǎn) pdf

      推薦:《PHP視頻教程》

      一、配置環(huán)境

      (1)配置php.ini

      添加:extension=php_com_dotnet.dll

      com.allow_dcom = true // 去掉號,改為true

      重啟環(huán)境

      (2) 安裝:WPS 專業(yè)版,或者 microsoft office 2010

      (microsoft office 2007 需要安裝加載項:Microsoft Save as PDF)

      (3)配置office組件服務(wù)

      按 win+R 快捷鍵進入運行菜單,輸入 Dcomcnfg

      找到: [組件服務(wù)] —— [計算機]—— [我的電腦] —— [DCOM配置] ——【wps……】或[Microsoft Wrord 97-2003文檔]

      如果沒找到【wps……】或(Microsoft Wrord 97-2003文檔):

      按 win+R 快捷鍵進入運行菜單

      輸入:mmc -32

      [文件]——[添加或刪除管理單元]——[組件服務(wù)](從可用管理單元,添加到所選管理單元,點擊:確定)

      添加完以后,在控制臺根節(jié)點下,找到【wps……】或[Microsoft Wrord 97-2003文檔],右鍵設(shè)置屬性,設(shè)置“標(biāo)識”為:交互式用戶(還有安全里面的設(shè)置 可以看其他文章的設(shè)置)

      php office如何轉(zhuǎn) pdf

      php office如何轉(zhuǎn) pdf

      注:我開始 選擇交互式用戶 : 會出現(xiàn) 我登錄遠程服務(wù)器一切正常,如果退出遠程服務(wù)器實例化組件就報錯,最后選擇了 下列用戶,填寫了管理員用戶和密碼才正??捎?

      二、編寫程序

      <?php  word2pdf(); function word2pdf() {    $filenamedoc = dirname(__FILE__)."/index.docx";    $filenamepdf = dirname(__FILE__)."/index.pdf";    $dd = $word = new COM("KWPS.Application") or die ("Could not initialise Object.");    // 或者 $dd = $word = new COM("Word.Application") or die ("Could not initialise Object.");     // set it to 1 to see the MS Word window (the actual opening of the document)     $word->Visible = 0;    // recommend to set to 0, disables alerts like "Do you want MS Word to be the default .. etc"     $word->DisplayAlerts = 0;    // open the word 2007-2013 document      $word->Documents->Open($filenamedoc);    // save it as word 2003     // convert word 2007-2013 to PDF      //判斷要生成的文件名是否存在     if(file_exists($filenamepdf)) {        //存在就刪除         unlink ($filenamepdf);     }    $word->ActiveDocument->ExportAsFixedFormat($filenamepdf, 17, false, 0, 0, 0, 0, 7, true, true, 2, true, true, false);    // quit the Word process     $word->Quit(false);    // clean up     unset($word);    if(!function_exists('read_pdf')) {        header('Content-type: application/pdf');        header('filename='.$filenamepdf);        readfile($filenamepdf);         read_pdf('Python_study.pdf');     }    echo 'ok'; }?>

      if(!function_exists('read_pdf')) {  function read_pdf($file) {    if(strtolower(substr(strrchr($file,'.'),1)) != 'pdf') {      echo '文件格式不對.';      return;     }    if(!file_exists($file)) {      echo '文件不存在';      return;     }    header('Content-type: application/pdf');    header('filename='.$file);    readfile($file);   } }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號