开发者

How to change already existed RTF files to PDF files by using php script..? [duplicate]

This question already has answers here: 开发者_JS百科 Closed 11 years ago.

Possible Duplicate:

rtf format to pdf

This is very important for me.. We have to change many existing rtf files into pdf files in our live website.. So plz kindly give a solution... I need a php script to change many existing rtf files to pdf ...!!

Thank u in advance..!!


PHP is not supposed to be used to convert files. It's a scripting language for web sites.

What you need is a) a software which can convert from RTF to PDF and can be called through command line and b) a batch script which calls the software.

An example of such software is GhostScript.

Since you didn't specify any information in you question, further help is impossible.


You can do it with open office: Download http://www.artofsolving.com/opensource/pyodconverter DocumentConverter.py and palce it in the same folder with soffice.exe. Then start OOffice as a service ( soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -headless -norestore -nologo -nofirststartwizard ) and then in PHP use it like this:

exec('python "path\to\this\file\DocumentConverter.py" path_to_doc\test.rtf path_to_output_pdf\test.pdf"'); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜