Convert MS-Office to pdf

爷,独闯天下 提交于 2019-12-14 03:27:29

问题


I'm using OfficeToPDF to convert the MS-Office files to pdf. However, I only can run the command:

OfficeToPDF test.doc test.pdf

in cmd (windows)

I want to embed this code into my cgi file (Perl). Can anyone show me how to do this, thank you!

(I used:

system("OfficeToPDF test.doc test.pdf");

but seems it's not work)


回答1:


That should work but your envormental parameters might not be setup right, you should include full paths(or proper relative ones) and see if that fixes the problem up. If not you might want to post your debug log, or enable verbose output. Your perl also might not be setup to execute shell commands for security reasons when in cgi mode and the logs would help clarify that.




回答2:


Try to:

  • use the full paths to OfficeToPDF and target PDF location because usually, the CGI scripts are run in another user context,
  • check, the CGI user has reading and writing rights for both files (and, off sure, right to execute the OfficeToPDF)

But it depends what means "it's not work", of sure.



来源:https://stackoverflow.com/questions/11796414/convert-ms-office-to-pdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!