`
刘逸君
  • 浏览: 37708 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

php利用openoffice把doc转换为PDF, txt or HTML

    博客分类:
  • php
阅读更多

参考文档:http://www.lampdeveloper.co.uk/linux/converting-doc-to-pdf-txt-or-html-using-php-and-linux.html

主要是利用openoffice文档转换服务

This basically creates the following deamon

soffice.bin -nologo -nodefault -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext

You can now send requests to port 2002 using unoconv

/usr/bin/unoconv --server localhost --port 2002 --stdout -f pdf input.doc

<?php

$args = '/usr/bin/unoconv --server localhost --port 2002 --stdout -f pdf ' . 目标文件地址 ; 

$pdf = shell_exec ( $run );  


?>

 

0
0
分享到:
评论
1 楼 ldl_xz 2014-02-26  
http://www.9958.pw/post/wenku 参考参考

相关推荐

Global site tag (gtag.js) - Google Analytics