用PHP填写Microsoft Word表单 [英] Fill in a Microsoft Word Form with PHP

查看:217
本文介绍了用PHP填写Microsoft Word表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Microsoft Word中创建的表单,我需要通过PHP填写该表单.我看过PHPWord,但是看起来您只能用它创建Word文档.我考虑过将表单导出为XML并以这种方式进行编辑,但是格式化在导出过程中变得很棘手.还有另一种方法吗?

I have a form created in Microsoft Word that I need to fill in via PHP. I have looked at PHPWord, but it looks like you can only create Word documents with it. I considered exporting the form to XML and editing it that way, but the formatting gets screwy from the export. Is there another way?

推荐答案

在撰写本文时,尚无直接解决方案.

At the time of writing this, there is no direct solution.

您可能希望查看在Linux中使用PHP创建Word文档以获得提示(使用可以更改的OpenOffice文档,因为它们是XML + ZIP,并在cmdline上将opendocument转换为.doc).

You might want to have a look at the best answer for Create Word Document using PHP in Linux to get a hint (uses OpenOffice documents that you can change since they are XML+ZIP, and converts opendocument to .doc on cmdline).

另一种替代方法是-如果您在Windows服务器上运行脚本-使用COM界面与Word对话.参见 http://drewd .com/2007/01/25/reading-from-a-word-document-with-com-in-php 作为读取文件的示例,并且-通过浏览Word COM API,您可以还可以更改现有文档.

Another alternative is - if you run your script on a windows server - to use the COM interface to speak with Word. See http://drewd.com/2007/01/25/reading-from-a-word-document-with-com-in-php for an example to read a file, and - by digging through the Word COM API - you can also change existing documents.

这篇关于用PHP填写Microsoft Word表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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