使用DocumentConverter.py在C#中将Word转换为PDF [英] Convertion of Word to PDF in C# using DocumentConverter.py

查看:226
本文介绍了使用DocumentConverter.py在C#中将Word转换为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想使用Open Office将Word文件转换为pdf.经过研究后,我发现 http://www.oooninja.com/2008/02/batch-command-line-file-conversion-with.html [ 我在cmd.exe中使用了上面的脚本,但是它不起作用.我是否需要安装某些东西才能使它正常工作.我想将此集成到我的C#应用​​程序中.

请帮助我.

谢谢,

Hi,

I want to convert a word file to pdf using Open office. after doing some research I found http://www.oooninja.com/2008/02/batch-command-line-file-conversion-with.html[^] which shows to use
"C:\Program Files\OpenOffice.org2.4\program\soffice.exe" -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager "C:\Program Files\OpenOffice.org2.4\program\python" DocumentConverter.py test.odt test.pdf
I have used the above script in cmd.exe but it does not work . Do I need to install something to get this working. I want to integrate this into my C# application.

Please help me in this.

Thanks,

推荐答案



感谢您的答复,我在计算机上安装了开放办公室,也安装了Python 2.7.但是,当我执行"C:\ Program Files \ OpenOffice.org2.4 \ program \ soffice.exe"时,-headless -nologo- norestore -accept = socket,host = localhost,port = 8100; urp; StarSuite.ServiceManager"C:\ Program Files \ OpenOffice.org2.4 \ program \ python" DocumentConverter.py test.odt test.pdf

系统仅打开文件DocumentConverter.py.似乎无法将DocumentConverter.py检测为python文件.我坚持这一点.请帮助我.

谢谢
Hi,

thanks for your response I have open office installed on my machine and I have also installed Python 2.7., but when I execute the "C:\Program Files\OpenOffice.org2.4\program\soffice.exe" -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager "C:\Program Files\OpenOffice.org2.4\program\python" DocumentConverter.py test.odt test.pdf

the system just opens the file DocumentConverter.py. Seems like it is not able to detect DocumentConverter.py as a python file. I am stuck with this. Please help me in this.

Thanks,


这篇关于使用DocumentConverter.py在C#中将Word转换为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆