duandong1869 2019-03-21 16:03
浏览 256

Ghostscript:当我尝试将pdf转换为1.4时返回一个空页面

I'm writing a PHP script that combines 2 pdf together, I'm using the FPDI library but it doesn't support the 1.5 version of pdf. So I'm trying to run this code before merging the files (only if file version is 1.5):

exec("gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile={$url} {$url}")

(the $url variable is repeated in input and output because I want to overwrite the v1.5 file stored in $url), however that script returns an empty page, i don't know why. can someone help me? thanks

  • 写回答

1条回答 默认 最新

  • douxian7117 2019-03-21 16:32
    关注

    You can't do that. As soon as pdfwrite starts processing it opens the output file for writing, this instantly overwrites the file its using to read from.

    You cannot write a new PDF file on top of the old one.

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程