彰化一整天的論壇

 找回密碼
 立即註冊
查看: 464|回復: 0

php將pdf轉換成tiff檔案

[複製鏈接]
發表於 2017-3-15 09:21:03 | 顯示全部樓層 |閱讀模式


  1. //location of input and output directory
  2. $datadir = "/var/www/data/";

  3. $outputTiffFileName = $datadir."FaxDocument.tiff";
  4. $inputPDFFileName = $datadir."MyPDFtoConvert.pdf";

  5. //ghost script command to run
  6. $cmd = "gs -SDEVICE=tiffg4 -r600x600 -sPAPERSIZE=letter -sOutputFile=$outputTiffFileName -dNOPAUSE -dBATCH  $inputPDFFileName";

  7. //Execute the ghost script that takes the PDF as an input and coverts and saves the it in the data directory.
  8. $response = shell_exec($cmd);
複製代碼
資料來源: https://phpdave.wordpress.com/20 ... hp-and-ghostscript/
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

 ㄚ母滴雞湯
 員林香純滴雞精

Archiver|手機版|小黑屋|彰化一整天的論壇(Excel,Office)  |网站地图

GMT+8, 2019-8-21 20:11 , Processed in 0.124526 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表